summaryrefslogtreecommitdiffstats
path: root/lib/libutil/expand_number.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libutil/expand_number.c')
-rw-r--r--lib/libutil/expand_number.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libutil/expand_number.c b/lib/libutil/expand_number.c
index 5d55884..0a62c12 100644
--- a/lib/libutil/expand_number.c
+++ b/lib/libutil/expand_number.c
@@ -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;
OpenPOWER on IntegriCloud