summaryrefslogtreecommitdiff
path: root/lib/smb.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-02-09 14:29:03 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-02-09 22:13:41 +0100
commit23722c515fc416ac4b024b49cba8758c329990cf (patch)
treeb5c8fdf78fcb834eedfca1c8f69323c230fcfe34 /lib/smb.c
parent1c680e35abd384f89ccd32ce91ade7101887e333 (diff)
downloadcurl-23722c515fc416ac4b024b49cba8758c329990cf.tar.gz
get_posix_time: only check for overflows if they can happen!
Diffstat (limited to 'lib/smb.c')
-rw-r--r--lib/smb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/smb.c b/lib/smb.c
index e5ac5d76a..b4326341e 100644
--- a/lib/smb.c
+++ b/lib/smb.c
@@ -716,11 +716,13 @@ static void get_posix_time(time_t *out, curl_off_t timestamp)
{
timestamp -= 116444736000000000;
timestamp /= 10000000;
+#if SIZEOF_TIME_T < SIZEOF_CURL_OFF_T
if(timestamp > TIME_T_MAX)
*out = TIME_T_MAX;
else if(timestamp < TIME_T_MIN)
*out = TIME_T_MIN;
else
+#endif
*out = (time_t) timestamp;
}