philipp / rpms / dhcp

Forked from rpms/dhcp 4 years ago
Clone

Blame SOURCES/dhcp-4.2.4-64_bit_lease_parse.patch

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