POSIXed strtoll() (and ours one too) can set errno to EINVAL, so check
it first. Approved by: andre
This commit is contained in:
parent
476d186675
commit
93d3ecbce2
@ -51,7 +51,7 @@ strtonum(const char *numstr, long long minval, long long maxval,
|
||||
error = INVALID;
|
||||
else {
|
||||
ll = strtoll(numstr, &ep, 10);
|
||||
if (numstr == ep || *ep != '\0')
|
||||
if (errno == EINVAL || numstr == ep || *ep != '\0')
|
||||
error = INVALID;
|
||||
else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval)
|
||||
error = TOOSMALL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user