aboutsummaryrefslogtreecommitdiffstats
path: root/src/apoint.c
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2016-03-27 12:54:10 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2016-03-27 13:06:18 +0200
commit9e160fac16e81c42ac368f450b9cc4df29753e00 (patch)
tree9fe79f9b549f840b0d93cdfd79554e32f8e62dc1 /src/apoint.c
parente1b6d226692ddaa8a9f077796a23317d36cd5d10 (diff)
downloadcalcurse-9e160fac16e81c42ac368f450b9cc4df29753e00.tar.gz
calcurse-9e160fac16e81c42ac368f450b9cc4df29753e00.zip
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 <jerning@home.se> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/apoint.c')
-rw-r--r--src/apoint.c3
1 files changed, 1 insertions, 2 deletions
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)