diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2015-01-19 23:47:55 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2015-02-07 09:52:36 +0100 |
commit | a12833ec086d5e0d35eac04f7e3c386879beccc0 (patch) | |
tree | 6e652ed622cacf90adfe7e7d577947249dbca3f5 /src/utils.c | |
parent | 4fd8f0b11e565587f349b910b3abfd16b611e767 (diff) | |
download | calcurse-a12833ec086d5e0d35eac04f7e3c386879beccc0.zip |
Handle dates past January 19th, 2038
Try to support dates past year 2038 on systems with 64-bit time_t.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/utils.c b/src/utils.c index 527dec8..bfcae99 100644 --- a/src/utils.c +++ b/src/utils.c @@ -651,10 +651,8 @@ char *new_tempfile(const char *prefix) */ int check_date(unsigned year, unsigned month, unsigned day) { - return (year >= 1902 && year <= 2037 && month >= 1 && month <= 12 - && day >= 1 && day <= days[month - 1] + (month == 2 - && ISLEAP(year)) ? - 1 : 0); + return (year >= 1902 && month >= 1 && month <= 12 && day >= 1 && + day <= days[month - 1] + (month == 2 && ISLEAP(year)) ? 1 : 0); } /* |