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
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue