]> git.netwichtig.de Git - user/henk/code/snooze.git/blobdiff - snooze.c
unset tm_isdst before doing date operations
[user/henk/code/snooze.git] / snooze.c
index ef97098faf4197568e60ba11a87711c50b0b634a..1dda3ebbc04e90f794b14226e46f0d72bfcddd9a 100644 (file)
--- a/snooze.c
+++ b/snooze.c
@@ -140,8 +140,8 @@ parse(char *expr, char *buf, long bufsiz, int offset)
 }
 
 char weekday[8] = {0};
-char dayofmonth[31] = {0};
-char month[12] = {0};
+char dayofmonth[32] = {0};
+char month[13] = {0};
 char dayofyear[367] = {0};
 char weekofyear[54] = {0};
 char hour[24] = {0};
@@ -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;
        }