From 5054b2689913376041f230cbea5e84afeda35096 Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Sun, 9 Nov 2008 18:06:51 -0600 Subject: [PATCH] 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. --- src/lib/common/hours.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/common/hours.c b/src/lib/common/hours.c index bd12a7ad..b07f2d1a 100644 --- a/src/lib/common/hours.c +++ b/src/lib/common/hours.c @@ -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;