X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fopt%2Fhelpers.c;h=e531a7d3aa2bc9d250e0608f21f0604d66e13733;hb=b377324e5c1ad356b535f4c3724251c626abdf40;hp=747a78e9139b875e7f7f6620d194510418c2c300;hpb=b989e06c093fb7a2befae277f684fa75b64b9ef5;p=ccan diff --git a/ccan/opt/helpers.c b/ccan/opt/helpers.c index 747a78e9..e531a7d3 100644 --- a/ccan/opt/helpers.c +++ b/ccan/opt/helpers.c @@ -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)