version 1.22, 2010/07/31 08:54:42 |
version 1.23, 2013/04/19 17:28:06 |
|
|
} |
} |
DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) |
DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) |
? 29 : 28; |
? 29 : 28; |
/* Checking for 2038 bogusly assumes that time_t is 32 bits. But |
/* XXX Sloppily check for 2038 if time_t is 32 bits */ |
I'm too lazy to try to check for time_t overflow in another way. */ |
if (Year < YEAR_EPOCH || |
if (Year < YEAR_EPOCH || Year > 2038 || Month < 1 || Month > 12 || |
(sizeof(time_t) == sizeof(int) && Year > 2038) || |
|
Month < 1 || Month > 12 || |
/* Lint fluff: "conversion from long may lose accuracy" */ |
/* Lint fluff: "conversion from long may lose accuracy" */ |
Day < 1 || Day > DaysInMonth[(int)--Month]) |
Day < 1 || Day > DaysInMonth[(int)--Month]) |
return (-1); |
return (-1); |