commit a1d27e57c214f3641b83b5e568d7b3c31c583ed3
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Mon Dec 4 23:03:42 2017 +0100
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Mon Dec 4 23:03:58 2017 +0100
Fix regression bug: the string "0" is an acceptable integer
Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
diff --git a/src/util.c b/src/util.c
index 1f0da6a..a8af373 100644
--- a/src/util.c
+++ b/src/util.c
_AT_@ -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;
}
Received on Mon Dec 04 2017 - 23:04:21 CET
This archive was generated by hypermail 2.3.0
: Mon Dec 04 2017 - 23:12:25 CET