]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix atoint for out of range
authorRoy Marples <roy@marples.name>
Thu, 15 Nov 2007 17:58:39 +0000 (17:58 +0000)
committerRoy Marples <roy@marples.name>
Thu, 15 Nov 2007 17:58:39 +0000 (17:58 +0000)
dhcpcd.c

index fdd65ca9fae233d703f5aacea636784e8140b9ae..ca24042bef2feed53cd6cedf26aff2a35948b0b7 100644 (file)
--- 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)))
        {