21255d
From 91ed5edcdea79773f6918e739637521e47129b07 Mon Sep 17 00:00:00 2001
21255d
From: Lennart Poettering <lennart@poettering.net>
21255d
Date: Mon, 1 Jun 2020 17:10:27 +0200
21255d
Subject: [PATCH] parse-util: make return parameter optional in
21255d
 safe_atou16_full()
21255d
21255d
All other safe_atoXYZ_full() functions have the parameter optional,
21255d
let's make it optoinal here, too.
21255d
21255d
(cherry picked from commit aa85e4d3cef8ca8436e480bce9fa4ce72876b636)
21255d
21255d
Related: #1848373
21255d
---
21255d
 src/basic/parse-util.c | 4 +++-
21255d
 1 file changed, 3 insertions(+), 1 deletion(-)
21255d
21255d
diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
21255d
index 53d181dd60..7a7cefe6ff 100644
21255d
--- a/src/basic/parse-util.c
21255d
+++ b/src/basic/parse-util.c
21255d
@@ -559,7 +559,9 @@ int safe_atou16_full(const char *s, unsigned base, uint16_t *ret) {
21255d
         if ((unsigned long) (uint16_t) l != l)
21255d
                 return -ERANGE;
21255d
 
21255d
-        *ret = (uint16_t) l;
21255d
+        if (ret)
21255d
+                *ret = (uint16_t) l;
21255d
+
21255d
         return 0;
21255d
 }
21255d