forked from github/server
prevent atoip setting errno on mac.
only call atoi when string starts with a digit
This commit is contained in:
parent
e293741997
commit
c512d180f8
|
@ -250,7 +250,7 @@ unsigned int atoip(const char *s)
|
|||
int n;
|
||||
|
||||
assert(s);
|
||||
n = atoi(s);
|
||||
n = isdigit(s[0]) ? atoi(s) : 0;
|
||||
|
||||
if (n < 0)
|
||||
n = 0;
|
||||
|
|
Loading…
Reference in New Issue