summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/stdlib/strtonum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/stdlib/strtonum.c b/libc/stdlib/strtonum.c
index 0bf29c3..6dccd97 100644
--- a/libc/stdlib/strtonum.c
+++ b/libc/stdlib/strtonum.c
@@ -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;