diff options
author | Leah Neukirchen <leah@vuxu.org> | 2018-05-03 18:42:18 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2018-05-03 18:42:18 +0200 |
commit | fba7f29a7d5e649d91ac1edd09b70ee28b22743e (patch) | |
tree | 09cb53bb7574013a90d2b95943c9539fabc3aead /snooze.c | |
parent | 5ae1ed39658d95d26fd5b0af235b1b72d7205015 (diff) | |
download | snooze-3027c580b50c028d5b3c3617704bf987a7897a83.tar.gz snooze-3027c580b50c028d5b3c3617704bf987a7897a83.tar.xz snooze-3027c580b50c028d5b3c3617704bf987a7897a83.zip |
unset tm_isdst before doing date operations v0.3
Else mktime(3) can change tm_hour due to DST change.
Diffstat (limited to 'snooze.c')
-rw-r--r-- | snooze.c | 3 |
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; } |