I made the same fix here, that Tor already did in the ftp.c code. To make
authorDaniel Stenberg <daniel@haxx.se>
Fri, 13 Feb 2004 07:03:03 +0000 (07:03 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 13 Feb 2004 07:03:03 +0000 (07:03 +0000)
sure this doesn't get weird on 64bit archs.

lib/file.c

index 2eeb527..3bfc342 100644 (file)
@@ -206,11 +206,12 @@ CURLcode Curl_file(struct connectdata *conn)
 #ifdef HAVE_STRFTIME
     if(fstated) {
       struct tm *tm;
+      time_t clock = (time_t)statbuf.st_mtime;
 #ifdef HAVE_GMTIME_R
       struct tm buffer;
-      tm = (struct tm *)gmtime_r((time_t *)&statbuf.st_mtime, &buffer);
+      tm = (struct tm *)gmtime_r(&clock, &buffer);
 #else
-      tm = gmtime((time_t *)&statbuf.st_mtime);
+      tm = gmtime(&clock);
 #endif
       /* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
       strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S GMT\r\n",