prevent atoip setting errno on mac.

only call atoi when string starts with a digit
This commit is contained in:
Enno Rehling 2016-11-14 22:15:52 +01:00
parent e293741997
commit c512d180f8
1 changed files with 1 additions and 1 deletions

View File

@ -250,7 +250,7 @@ unsigned int atoip(const char *s)
int n; int n;
assert(s); assert(s);
n = atoi(s); n = isdigit(s[0]) ? atoi(s) : 0;
if (n < 0) if (n < 0)
n = 0; n = 0;