Check strtoumax(3) for ERANGE in case of non-prefixed string.
OK'd by: silence on current@ MFC after: 1 week
This commit is contained in:
parent
28a288cbaa
commit
869f276295
@ -55,6 +55,10 @@ expand_number(const char *buf, uint64_t *num)
|
||||
|
||||
number = strtoumax(buf, &endptr, 0);
|
||||
|
||||
if (number == UINTMAX_MAX && errno == ERANGE) {
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (endptr == buf) {
|
||||
/* No valid digits. */
|
||||
errno = EINVAL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user