From a1d27e57c214f3641b83b5e568d7b3c31c583ed3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 4 Dec 2017 23:03:42 +0100 Subject: Fix regression bug: the string "0" is an acceptable integer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 1f0da6a..a8af373 100644 --- a/src/util.c +++ b/src/util.c @@ -37,7 +37,7 @@ tollu(const char *s, unsigned long long int min, unsigned long long int max, uns return -1; } if (!isdigit(s[*s == 'x' || *s == 'X' || *s == '#']) || - (*s == '0' && !isdigit(s[1 + (*s == 'x' || *s == 'o' || *s == 'b')]))) { + (*s == '0' && s[1] && !isdigit(s[1 + (*s == 'x' || *s == 'o' || *s == 'b')]))) { errno = EINVAL; return -1; } -- cgit v1.2.3-70-g09d2