POSIX strto*() functions MAY return EINVAL, so don't assume that only one
errno from them allowed and it is always ERANGE
This commit is contained in:
parent
588c679809
commit
7c495473b7
@ -470,7 +470,8 @@ getn(s)
|
||||
r = strtol(s, &p, 10);
|
||||
|
||||
if (errno != 0)
|
||||
error("%s: out of range", s);
|
||||
error((errno == EINVAL) ? "%s: bad number" :
|
||||
"%s: out of range", s);
|
||||
|
||||
while (isspace((unsigned char)*p))
|
||||
p++;
|
||||
@ -493,7 +494,8 @@ getq(s)
|
||||
r = strtoq(s, &p, 10);
|
||||
|
||||
if (errno != 0)
|
||||
error("%s: out of range", s);
|
||||
error((errno == EINVAL) ? "%s: bad number" :
|
||||
"%s: out of range", s);
|
||||
|
||||
while (isspace((unsigned char)*p))
|
||||
p++;
|
||||
|
Loading…
Reference in New Issue
Block a user