summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/strtonum.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/strtonum.c')
-rw-r--r--lib/libc/stdlib/strtonum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/strtonum.c b/lib/libc/stdlib/strtonum.c
index 9ac0d34ee00..a7f07c9062c 100644
--- a/lib/libc/stdlib/strtonum.c
+++ b/lib/libc/stdlib/strtonum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtonum.c,v 1.1 2004/05/03 17:09:24 tedu Exp $ */
+/* $OpenBSD: strtonum.c,v 1.2 2004/05/03 20:53:34 millert Exp $ */
/*
* Copyright (c) 2004 Ted Unangst and Todd Miller
* All rights reserved.
@@ -48,7 +48,7 @@ strtonum(const char *numstr, long long minval, unsigned long long maxval,
if (minval > maxval || maxval < minval ||
(minval < 0 && maxval > LLONG_MAX))
error = INVALID;
- else if (minval >= 0) {
+ else if (maxval > LLONG_MAX ) {
ull = strtoull(numstr, &ep, 10);
if (numstr == ep || *ep != '\0')
error = INVALID;