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