From 9e160fac16e81c42ac368f450b9cc4df29753e00 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 27 Mar 2016 12:54:10 +0200 Subject: Do not assume that days always have 86400 seconds Make that date membership is computed correctly, even if a day has less than 86400 seconds (e.g. after changing clocks). Reported-by: Hakan Jerning Signed-off-by: Lukas Fleischer --- src/apoint.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/apoint.c') diff --git a/src/apoint.c b/src/apoint.c index cb23ead..409e889 100644 --- a/src/apoint.c +++ b/src/apoint.c @@ -119,8 +119,7 @@ struct apoint *apoint_new(char *mesg, char *note, long start, long dur, unsigned apoint_inday(struct apoint *i, long *start) { - return (i->start <= *start + DAYINSEC - && i->start + i->dur > *start); + return (date_cmp_day(i->start, *start) == 0); } void apoint_sec2str(struct apoint *o, long day, char *start, char *end) -- cgit v1.2.3-54-g00ecf