From: Roy Marples Date: Thu, 15 Nov 2007 17:58:39 +0000 (+0000) Subject: Fix atoint for out of range X-Git-Tag: v3.2.3~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbcd33d4f5cd992c106d68a4d517e90d3d4e8486;p=thirdparty%2Fdhcpcd.git Fix atoint for out of range --- diff --git a/dhcpcd.c b/dhcpcd.c index fdd65ca9..ca24042b 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -107,9 +107,10 @@ char *dhcpcd_skiproutes = NULL; static int atoint (const char *s) { char *t; - long n = strtol (s, &t, 0); - + long n; + errno = 0; + n = strtol (s, &t, 0); if ((errno != 0 && n == 0) || s == t || (errno == ERANGE && (n == LONG_MAX || n == LONG_MIN))) {