From c512d180f84e6d8484188bb281964c177c1ec91a Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 14 Nov 2016 22:15:52 +0100 Subject: [PATCH] prevent atoip setting errno on mac. only call atoi when string starts with a digit --- src/util/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/parser.c b/src/util/parser.c index 741fd573f..b13e266a6 100644 --- a/src/util/parser.c +++ b/src/util/parser.c @@ -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;