]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/dhcp/dhcp-64_bit_lease_parse.patch
aarch64: Fix rootfile for Python
[ipfire-2.x.git] / src / patches / dhcp / dhcp-64_bit_lease_parse.patch
1 diff -up dhcp-4.3.0a1/common/parse.c.64-bit_lease_parse dhcp-4.3.0a1/common/parse.c
2 --- dhcp-4.3.0a1/common/parse.c.64-bit_lease_parse 2013-12-11 01:25:12.000000000 +0100
3 +++ dhcp-4.3.0a1/common/parse.c 2013-12-19 15:45:25.990771814 +0100
4 @@ -938,8 +938,8 @@ TIME
5 parse_date_core(cfile)
6 struct parse *cfile;
7 {
8 - int guess;
9 - int tzoff, year, mon, mday, hour, min, sec;
10 + TIME guess;
11 + long int tzoff, year, mon, mday, hour, min, sec;
12 const char *val;
13 enum dhcp_token token;
14 static int months[11] = { 31, 59, 90, 120, 151, 181,
15 @@ -965,7 +965,7 @@ parse_date_core(cfile)
16 }
17
18 skip_token(&val, NULL, cfile); /* consume number */
19 - guess = atoi(val);
20 + guess = atol(val);
21
22 return((TIME)guess);
23 }
24 @@ -993,7 +993,7 @@ parse_date_core(cfile)
25 somebody invents a time machine, I think we can safely disregard
26 it. This actually works around a stupid Y2K bug that was present
27 in a very early beta release of dhcpd. */
28 - year = atoi(val);
29 + year = atol(val);
30 if (year > 1900)
31 year -= 1900;
32
33 @@ -1039,7 +1039,7 @@ parse_date_core(cfile)
34 return((TIME)0);
35 }
36 skip_token(&val, NULL, cfile); /* consume day of month */
37 - mday = atoi(val);
38 + mday = atol(val);
39
40 /* Hour... */
41 token = peek_token(&val, NULL, cfile);
42 @@ -1050,7 +1050,7 @@ parse_date_core(cfile)
43 return((TIME)0);
44 }
45 skip_token(&val, NULL, cfile); /* consume hour */
46 - hour = atoi(val);
47 + hour = atol(val);
48
49 /* Colon separating hour from minute... */
50 token = peek_token(&val, NULL, cfile);
51 @@ -1072,7 +1072,7 @@ parse_date_core(cfile)
52 return((TIME)0);
53 }
54 skip_token(&val, NULL, cfile); /* consume minute */
55 - min = atoi(val);
56 + min = atol(val);
57
58 /* Colon separating minute from second... */
59 token = peek_token(&val, NULL, cfile);
60 @@ -1094,13 +1094,13 @@ parse_date_core(cfile)
61 return((TIME)0);
62 }
63 skip_token(&val, NULL, cfile); /* consume second */
64 - sec = atoi(val);
65 + sec = atol(val);
66
67 tzoff = 0;
68 token = peek_token(&val, NULL, cfile);
69 if (token == NUMBER) {
70 skip_token(&val, NULL, cfile); /* consume tzoff */
71 - tzoff = atoi(val);
72 + tzoff = atol(val);
73 } else if (token != SEMI) {
74 skip_token(&val, NULL, cfile);
75 parse_warn(cfile,