2012-04-17 09:46:32 +00:00
|
|
|
diff -up dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse dhcp-4.2.4b1/common/parse.c
|
|
|
|
--- dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse 2012-03-09 12:28:10.000000000 +0100
|
|
|
|
+++ dhcp-4.2.4b1/common/parse.c 2012-04-16 17:30:55.867045149 +0200
|
|
|
|
@@ -906,8 +906,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,
|
2012-04-17 09:46:32 +00:00
|
|
|
@@ -933,7 +933,7 @@ parse_date_core(cfile)
|
2011-01-27 16:06:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
token = next_token(&val, NULL, cfile); /* consume number */
|
|
|
|
- guess = atoi(val);
|
|
|
|
+ guess = atol(val);
|
|
|
|
|
|
|
|
return((TIME)guess);
|
|
|
|
}
|
2012-04-17 09:46:32 +00:00
|
|
|
@@ -961,7 +961,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;
|
|
|
|
|
2012-04-17 09:46:32 +00:00
|
|
|
@@ -985,7 +985,7 @@ parse_date_core(cfile)
|
2011-01-27 16:06:55 +00:00
|
|
|
return((TIME)0);
|
|
|
|
}
|
|
|
|
token = next_token(&val, NULL, cfile); /* consume month */
|
|
|
|
- mon = atoi(val) - 1;
|
|
|
|
+ mon = atol(val) - 1;
|
|
|
|
|
|
|
|
/* Slash separating month from day... */
|
|
|
|
token = peek_token(&val, NULL, cfile);
|
2012-04-17 09:46:32 +00:00
|
|
|
@@ -1007,7 +1007,7 @@ parse_date_core(cfile)
|
2011-01-27 16:06:55 +00:00
|
|
|
return((TIME)0);
|
|
|
|
}
|
|
|
|
token = next_token(&val, NULL, cfile); /* consume day of month */
|
|
|
|
- mday = atoi(val);
|
|
|
|
+ mday = atol(val);
|
|
|
|
|
|
|
|
/* Hour... */
|
|
|
|
token = peek_token(&val, NULL, cfile);
|
2012-04-17 09:46:32 +00:00
|
|
|
@@ -1018,7 +1018,7 @@ parse_date_core(cfile)
|
2011-01-27 16:06:55 +00:00
|
|
|
return((TIME)0);
|
|
|
|
}
|
|
|
|
token = next_token(&val, NULL, cfile); /* consume hour */
|
|
|
|
- hour = atoi(val);
|
|
|
|
+ hour = atol(val);
|
|
|
|
|
|
|
|
/* Colon separating hour from minute... */
|
|
|
|
token = peek_token(&val, NULL, cfile);
|
2012-04-17 09:46:32 +00:00
|
|
|
@@ -1040,7 +1040,7 @@ parse_date_core(cfile)
|
2011-01-27 16:06:55 +00:00
|
|
|
return((TIME)0);
|
|
|
|
}
|
|
|
|
token = next_token(&val, NULL, cfile); /* consume minute */
|
|
|
|
- min = atoi(val);
|
|
|
|
+ min = atol(val);
|
|
|
|
|
|
|
|
/* Colon separating minute from second... */
|
|
|
|
token = peek_token(&val, NULL, cfile);
|
2012-04-17 09:46:32 +00:00
|
|
|
@@ -1062,13 +1062,13 @@ parse_date_core(cfile)
|
2011-01-27 16:06:55 +00:00
|
|
|
return((TIME)0);
|
|
|
|
}
|
|
|
|
token = next_token(&val, NULL, cfile); /* consume second */
|
|
|
|
- sec = atoi(val);
|
|
|
|
+ sec = atol(val);
|
|
|
|
|
|
|
|
tzoff = 0;
|
|
|
|
token = peek_token(&val, NULL, cfile);
|
|
|
|
if (token == NUMBER) {
|
|
|
|
token = next_token(&val, NULL, cfile); /* consume tzoff */
|
|
|
|
- tzoff = atoi(val);
|
|
|
|
+ tzoff = atol(val);
|
|
|
|
} else if (token != SEMI) {
|
|
|
|
token = next_token(&val, NULL, cfile);
|
|
|
|
parse_warn(cfile,
|