summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2018-05-03 18:42:18 +0200
committerLeah Neukirchen <leah@vuxu.org>2018-05-03 18:42:18 +0200
commitfba7f29a7d5e649d91ac1edd09b70ee28b22743e (patch)
tree09cb53bb7574013a90d2b95943c9539fabc3aead
parent5ae1ed39658d95d26fd5b0af235b1b72d7205015 (diff)
unset tm_isdst before doing date operationsv0.3
Else mktime(3) can change tm_hour due to DST change.
-rw-r--r--snooze.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/snooze.c b/snooze.c
index c08cdc3..1dda3eb 100644
--- a/snooze.c
+++ b/snooze.c
@@ -182,11 +182,14 @@ next_day:
tm->tm_mday++;
}
+ tm->tm_isdst = -1;
tm->tm_sec = 0;
tm->tm_min = 0;
tm->tm_hour = 0;
t = mktime(tm);
+ tm->tm_isdst = -1;
+
if (t > from+(366*24*60*60)) // no result within a year
return -1;
}