]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
parse-util: make return parameter optional in safe_atou16_full()
authorLennart Poettering <lennart@poettering.net>
Mon, 1 Jun 2020 15:10:27 +0000 (17:10 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 5 Jun 2020 13:56:31 +0000 (15:56 +0200)
All other safe_atoXYZ_full() functions have the parameter optional,
let's make it optoinal here, too.

src/basic/parse-util.c

index 7344dc43115b431f313bc995c71597436b51077a..c58f2cdda1eb3dfaf584e2215500f133b465eb57 100644 (file)
@@ -535,7 +535,9 @@ int safe_atou16_full(const char *s, unsigned base, uint16_t *ret) {
         if ((unsigned long) (uint16_t) l != l)
                 return -ERANGE;
 
-        *ret = (uint16_t) l;
+        if (ret)
+                *ret = (uint16_t) l;
+
         return 0;
 }