]> git.ozlabs.org Git - ccan/blobdiff - ccan/opt/helpers.c
opt: always initialise values in set_llong_with_suffix()
[ccan] / ccan / opt / helpers.c
index 747a78e9139b875e7f7f6620d194510418c2c300..e531a7d3aa2bc9d250e0608f21f0604d66e13733 100644 (file)
@@ -238,9 +238,10 @@ static char *set_llong_with_suffix(const char *arg, long long *ll,
                                   const long long base)
 {
        char *endp;
-       if (!arg[0])
+       if (!arg[0]){
+               *ll = 0;
                return arg_bad("'%s' (an empty string) is not a number", arg);
-
+       }
        errno = 0;
        *ll = strtoll(arg, &endp, 0);
        if (errno)