commit 6ca5285e56b8e65f9e2bda9abb74b9771693e318
parent a26d541a6a97723666f0b25697ddd36b34b8d08f
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Mon, 21 Dec 2020 16:42:32 -0800
Fix strtorange() again
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main.c b/main.c
@@ -116,7 +116,7 @@ strtorange(unsigned int *r, unsigned int min, unsigned int max, const char *s)
warnc(EINVAL, "not a number '%s'", s);
return -1;
} else if ((errno == ERANGE && n == ULONG_MAX) ||
- n < min || n > max || n > UINT_MAX || n < UINT_MIN) {
+ n < min || n > max || n > UINT_MAX || n < 0) {
warnc(ERANGE, "'%s'", s);
return -1;
}