diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-06-01 17:10:27 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-06-05 15:56:31 +0200 |
commit | aa85e4d3cef8ca8436e480bce9fa4ce72876b636 (patch) | |
tree | a1b9a528e368c0af26c4ce77f22f44b7a9467eb3 /src/basic/parse-util.c | |
parent | parse-util: allow '-0' as alternative to '0' and '+0' (diff) | |
download | systemd-aa85e4d3cef8ca8436e480bce9fa4ce72876b636.tar.xz systemd-aa85e4d3cef8ca8436e480bce9fa4ce72876b636.zip |
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.
Diffstat (limited to 'src/basic/parse-util.c')
-rw-r--r-- | src/basic/parse-util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c index 7344dc4311..c58f2cdda1 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; } |