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>
This commit is contained in:
Lukas Fleischer
2015-01-19 23:47:55 +01:00
parent 4fd8f0b11e
commit a12833ec08
5 changed files with 36 additions and 13 deletions

View File

@@ -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);
}
/*