Blame SOURCES/dhcp-4.2.4-64_bit_lease_parse.patch

fad460
diff -up dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse dhcp-4.2.4b1/common/parse.c
fad460
--- dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse	2012-03-09 12:28:10.000000000 +0100
fad460
+++ dhcp-4.2.4b1/common/parse.c	2012-04-16 17:30:55.867045149 +0200
fad460
@@ -906,8 +906,8 @@ TIME
fad460
 parse_date_core(cfile)
fad460
 	struct parse *cfile;
fad460
 {
fad460
-	int guess;
fad460
-	int tzoff, year, mon, mday, hour, min, sec;
fad460
+	TIME guess;
fad460
+	long int tzoff, year, mon, mday, hour, min, sec;
fad460
 	const char *val;
fad460
 	enum dhcp_token token;
fad460
 	static int months[11] = { 31, 59, 90, 120, 151, 181,
fad460
@@ -933,7 +933,7 @@ parse_date_core(cfile)
fad460
 		}
fad460
 
fad460
 		token = next_token(&val, NULL, cfile); /* consume number */
fad460
-		guess = atoi(val);
fad460
+		guess = atol(val);
fad460
 
fad460
 		return((TIME)guess);
fad460
 	}
fad460
@@ -961,7 +961,7 @@ parse_date_core(cfile)
fad460
 	   somebody invents a time machine, I think we can safely disregard
fad460
 	   it.   This actually works around a stupid Y2K bug that was present
fad460
 	   in a very early beta release of dhcpd. */
fad460
-	year = atoi(val);
fad460
+	year = atol(val);
fad460
 	if (year > 1900)
fad460
 		year -= 1900;
fad460
 
fad460
@@ -985,7 +985,7 @@ parse_date_core(cfile)
fad460
 		return((TIME)0);
fad460
 	}
fad460
 	token = next_token(&val, NULL, cfile); /* consume month */	
fad460
-	mon = atoi(val) - 1;
fad460
+	mon = atol(val) - 1;
fad460
 
fad460
 	/* Slash separating month from day... */
fad460
 	token = peek_token(&val, NULL, cfile);
fad460
@@ -1007,7 +1007,7 @@ parse_date_core(cfile)
fad460
 		return((TIME)0);
fad460
 	}
fad460
 	token = next_token(&val, NULL, cfile); /* consume day of month */
fad460
-	mday = atoi(val);
fad460
+	mday = atol(val);
fad460
 
fad460
 	/* Hour... */
fad460
 	token = peek_token(&val, NULL, cfile);
fad460
@@ -1018,7 +1018,7 @@ parse_date_core(cfile)
fad460
 		return((TIME)0);
fad460
 	}
fad460
 	token = next_token(&val, NULL, cfile); /* consume hour */
fad460
-	hour = atoi(val);
fad460
+	hour = atol(val);
fad460
 
fad460
 	/* Colon separating hour from minute... */
fad460
 	token = peek_token(&val, NULL, cfile);
fad460
@@ -1040,7 +1040,7 @@ parse_date_core(cfile)
fad460
 		return((TIME)0);
fad460
 	}
fad460
 	token = next_token(&val, NULL, cfile); /* consume minute */
fad460
-	min = atoi(val);
fad460
+	min = atol(val);
fad460
 
fad460
 	/* Colon separating minute from second... */
fad460
 	token = peek_token(&val, NULL, cfile);
fad460
@@ -1062,13 +1062,13 @@ parse_date_core(cfile)
fad460
 		return((TIME)0);
fad460
 	}
fad460
 	token = next_token(&val, NULL, cfile); /* consume second */
fad460
-	sec = atoi(val);
fad460
+	sec = atol(val);
fad460
 
fad460
 	tzoff = 0;
fad460
 	token = peek_token(&val, NULL, cfile);
fad460
 	if (token == NUMBER) {
fad460
 		token = next_token(&val, NULL, cfile); /* consume tzoff */
fad460
-		tzoff = atoi(val);
fad460
+		tzoff = atol(val);
fad460
 	} else if (token != SEMI) {
fad460
 		token = next_token(&val, NULL, cfile);
fad460
 		parse_warn(cfile,