]> granicus.if.org Git - curl/commitdiff
get_posix_time: only check for overflows if they can happen!
authorDaniel Stenberg <daniel@haxx.se>
Fri, 9 Feb 2018 13:29:03 +0000 (14:29 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 9 Feb 2018 21:13:41 +0000 (22:13 +0100)
lib/smb.c

index e5ac5d76a876f223e2bd9d130e0a2602567b6117..b4326341ea24ff598bfac52ab055e8ee59842f8f 100644 (file)
--- 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;
 }