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:
Ron Koenderink 2008-11-09 18:06:51 -06:00
parent b27298d4c5
commit 5054b26899

View file

@ -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;