philipp / rpms / dhcp

Forked from rpms/dhcp 4 years ago
Clone

Blame SOURCES/dhcp-64_bit_lease_parse.patch

26a25c
diff -up dhcp-4.3.0a1/common/parse.c.64-bit_lease_parse dhcp-4.3.0a1/common/parse.c
26a25c
--- dhcp-4.3.0a1/common/parse.c.64-bit_lease_parse	2013-12-11 01:25:12.000000000 +0100
26a25c
+++ dhcp-4.3.0a1/common/parse.c	2013-12-19 15:45:25.990771814 +0100
26a25c
@@ -938,8 +938,8 @@ TIME
26a25c
 parse_date_core(cfile)
26a25c
 	struct parse *cfile;
26a25c
 {
26a25c
-	int guess;
26a25c
-	int tzoff, year, mon, mday, hour, min, sec;
26a25c
+	TIME guess;
26a25c
+	long int tzoff, year, mon, mday, hour, min, sec;
26a25c
 	const char *val;
26a25c
 	enum dhcp_token token;
26a25c
 	static int months[11] = { 31, 59, 90, 120, 151, 181,
26a25c
@@ -965,7 +965,7 @@ parse_date_core(cfile)
26a25c
 		}
26a25c
 
26a25c
 		skip_token(&val, NULL, cfile); /* consume number */
26a25c
-		guess = atoi(val);
26a25c
+		guess = atol(val);
26a25c
 
26a25c
 		return((TIME)guess);
26a25c
 	}
26a25c
@@ -993,7 +993,7 @@ parse_date_core(cfile)
26a25c
 	   somebody invents a time machine, I think we can safely disregard
26a25c
 	   it.   This actually works around a stupid Y2K bug that was present
26a25c
 	   in a very early beta release of dhcpd. */
26a25c
-	year = atoi(val);
26a25c
+	year = atol(val);
26a25c
 	if (year > 1900)
26a25c
 		year -= 1900;
26a25c
 
26a25c
@@ -1039,7 +1039,7 @@ parse_date_core(cfile)
26a25c
 		return((TIME)0);
26a25c
 	}
26a25c
 	skip_token(&val, NULL, cfile); /* consume day of month */
26a25c
-	mday = atoi(val);
26a25c
+	mday = atol(val);
26a25c
 
26a25c
 	/* Hour... */
26a25c
 	token = peek_token(&val, NULL, cfile);
26a25c
@@ -1050,7 +1050,7 @@ parse_date_core(cfile)
26a25c
 		return((TIME)0);
26a25c
 	}
26a25c
 	skip_token(&val, NULL, cfile); /* consume hour */
26a25c
-	hour = atoi(val);
26a25c
+	hour = atol(val);
26a25c
 
26a25c
 	/* Colon separating hour from minute... */
26a25c
 	token = peek_token(&val, NULL, cfile);
26a25c
@@ -1072,7 +1072,7 @@ parse_date_core(cfile)
26a25c
 		return((TIME)0);
26a25c
 	}
26a25c
 	skip_token(&val, NULL, cfile); /* consume minute */
26a25c
-	min = atoi(val);
26a25c
+	min = atol(val);
26a25c
 
26a25c
 	/* Colon separating minute from second... */
26a25c
 	token = peek_token(&val, NULL, cfile);
26a25c
@@ -1094,13 +1094,13 @@ parse_date_core(cfile)
26a25c
 		return((TIME)0);
26a25c
 	}
26a25c
 	skip_token(&val, NULL, cfile); /* consume second */
26a25c
-	sec = atoi(val);
26a25c
+	sec = atol(val);
26a25c
 
26a25c
 	tzoff = 0;
26a25c
 	token = peek_token(&val, NULL, cfile);
26a25c
 	if (token == NUMBER) {
26a25c
 		skip_token(&val, NULL, cfile); /* consume tzoff */
26a25c
-		tzoff = atoi(val);
26a25c
+		tzoff = atol(val);
26a25c
 	} else if (token != SEMI) {
26a25c
 		skip_token(&val, NULL, cfile);
26a25c
 		parse_warn(cfile,