aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/parsedate.c6
-rw-r--r--lib/setup.h5
2 files changed, 11 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;
diff --git a/lib/setup.h b/lib/setup.h
index e535279c8..2969b936a 100644
--- a/lib/setup.h
+++ b/lib/setup.h
@@ -287,6 +287,11 @@ typedef int curl_socket_t;
#define USE_LIBIDN
#endif
+#ifndef SIZEOF_TIME_T
+/* assume default size of time_t to be 32 bit */
+#define SIZEOF_TIME_T 4
+#endif
+
#define LIBIDN_REQUIRED_VERSION "0.4.1"
#endif /* __CONFIG_H */