From: Leah Neukirchen Date: Thu, 3 May 2018 16:42:18 +0000 (+0200) Subject: unset tm_isdst before doing date operations X-Git-Tag: v0.3 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=3027c580b50c028d5b3c3617704bf987a7897a83;p=user%2Fhenk%2Fcode%2Fsnooze.git unset tm_isdst before doing date operations Else mktime(3) can change tm_hour due to DST change. --- 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; }