Fix parsing of 24:00 in game_hours and update_demandtimes
daytime() rejects 24:00 as invalid. This makes daytime_range()
fail, is_daytime_allowed() ignore this and later ranges silently.
Broken in commit acdee1e3
, v4.2.15.
This commit is contained in:
parent
b27298d4c5
commit
5054b26899
1 changed files with 3 additions and 1 deletions
|
@ -153,7 +153,7 @@ daytime(char *str, int *min)
|
|||
unsigned long h, m;
|
||||
|
||||
h = strtoul(str, &end, 10);
|
||||
if (end == str || h > 23)
|
||||
if (end == str || h > 24)
|
||||
return NULL;
|
||||
|
||||
if (*end++ != ':')
|
||||
|
@ -163,6 +163,8 @@ daytime(char *str, int *min)
|
|||
m = strtoul(str, &end, 10);
|
||||
if (end == str || m > 59)
|
||||
return NULL;
|
||||
else if (h == 24 && m != 0)
|
||||
return NULL;
|
||||
|
||||
*min = 60 * h + m;
|
||||
return end;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue