From: Lennart Poettering Date: Mon, 1 Jun 2020 15:10:27 +0000 (+0200) Subject: parse-util: make return parameter optional in safe_atou16_full() X-Git-Tag: v246-rc1~202^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa85e4d3cef8ca8436e480bce9fa4ce72876b636;p=thirdparty%2Fsystemd.git parse-util: make return parameter optional in safe_atou16_full() All other safe_atoXYZ_full() functions have the parameter optional, let's make it optoinal here, too. --- diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c index 7344dc43115..c58f2cdda1e 100644 --- a/src/basic/parse-util.c +++ b/src/basic/parse-util.c @@ -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; }