]> git.netwichtig.de Git - user/henk/code/snooze.git/commitdiff
unset tm_isdst before doing date operations v0.3
authorLeah Neukirchen <leah@vuxu.org>
Thu, 3 May 2018 16:42:18 +0000 (18:42 +0200)
committerLeah Neukirchen <leah@vuxu.org>
Thu, 3 May 2018 16:42:18 +0000 (18:42 +0200)
Else mktime(3) can change tm_hour due to DST change.

snooze.c

index c08cdc34d67b120141c91df3dd405805624c76f4..1dda3ebbc04e90f794b14226e46f0d72bfcddd9a 100644 (file)
--- 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;
        }