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