diff options
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c index 8dbfa31..ff66fce 100644 --- a/src/config.c +++ b/src/config.c @@ -151,12 +151,15 @@ static int config_parse_unsigned(unsigned *dest, const char *val) static int config_parse_int(int *dest, const char *val) { - if ((*val == '+' || *val == '-' || isdigit(*val)) - && is_all_digit(val + 1)) + char *cp = (char *)val; + + if (*val == '+' || *val == '-') + cp++; + /* Test for empty string before checking for digits only. */ + if (*cp && is_all_digit(cp)) *dest = atoi(val); else return 0; - return 1; } |