aboutsummaryrefslogtreecommitdiff
path: root/lib/parsedate.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-11-11 09:26:09 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-11-11 09:26:09 +0000
commitcd73a733c78b7ab7b4e3ccaca9350bbcce124142 (patch)
tree4d9772c476213fa9c7f4034d7860c75f97b83dc5 /lib/parsedate.c
parent8ef8e949bd07a72918565f4482f8250a55a2f2dc (diff)
dates from 2038 or later now return 0x7fffffff when 32 bit time_t is used
Diffstat (limited to 'lib/parsedate.c')
-rw-r--r--lib/parsedate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/parsedate.c b/lib/parsedate.c
index 836340c07..e9e860fe6 100644
--- a/lib/parsedate.c
+++ b/lib/parsedate.c
@@ -350,6 +350,12 @@ static time_t Curl_parsedate(const char *date)
/* lacks vital info, fail */
return -1;
+#if SIZEOF_TIME_T < 5
+ /* 32 bit time_t can only hold dates to the beginning of 2038 */
+ if(yearnum > 2037)
+ return 0x7fffffff;
+#endif
+
tm.tm_sec = secnum;
tm.tm_min = minnum;
tm.tm_hour = hournum;