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:
Sergey Kandaurov 2013-08-21 16:46:06 +00:00
parent 28a288cbaa
commit 869f276295

View File

@ -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;