POSIXed strtoll() (and ours one too) can set errno to EINVAL, so check
it first. Approved by: andre
This commit is contained in:
parent
9e92c8d486
commit
7768950fe3
@ -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…
Reference in New Issue
Block a user