summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-11-15 17:58:39 +0000
committerRoy Marples <roy@marples.name>2007-11-15 17:58:39 +0000
commitbbcd33d4f5cd992c106d68a4d517e90d3d4e8486 (patch)
tree760bb0614259d201391eadcb36489cf49f1ae0dc /dhcpcd.c
parent05bea32986dfead298f0030e5361871948c78da6 (diff)
downloaddhcpcd-bbcd33d4f5cd992c106d68a4d517e90d3d4e8486.tar.xz
Fix atoint for out of range
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c5
1 files changed, 3 insertions, 2 deletions
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)))
{