From bbcd33d4f5cd992c106d68a4d517e90d3d4e8486 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 15 Nov 2007 17:58:39 +0000 Subject: [PATCH] Fix atoint for out of range --- dhcpcd.c | 5 +++-- 1 file 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))) { -- 2.47.3