summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2019-08-01 07:19:14 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2019-09-06 18:15:36 -0400
commita0305d754fb03f87495c1f074f07ee5dbb2fbd6f (patch)
treed93c9e290820cd171f0a6ce82e2be16412707d3b /src
parent5fbc499886e93f681f05b7219c7f844d17eaeb1d (diff)
downloadcalcurse-a0305d754fb03f87495c1f074f07ee5dbb2fbd6f.tar.gz
calcurse-a0305d754fb03f87495c1f074f07ee5dbb2fbd6f.zip
DST: fix date_change() thoroughly
Explicit setting of Daylight Saving Time should be avoided before as well as after the mktime() call. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src')
-rw-r--r--src/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c
index 8a8de75..a9a9e68 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -525,10 +525,11 @@ int date_change(struct tm *date, int delta_month, int delta_day)
t = *date;
t.tm_mon += delta_month;
t.tm_mday += delta_day;
-
+ t.tm_isdst = -1;
if (mktime(&t) == -1) {
return 1;
} else {
+ t.tm_isdst = -1;
*date = t;
return 0;
}