]> sjero.net Git - wget/commitdiff
Don't assume time_t* is compatible with long*.
authorMicah Cowan <micah@cowan.name>
Tue, 24 Jun 2008 18:44:40 +0000 (11:44 -0700)
committerMicah Cowan <micah@cowan.name>
Tue, 24 Jun 2008 18:44:40 +0000 (11:44 -0700)
src/ChangeLog
src/ftp-ls.c

index 7ed11cb1956d1f9806e82e767e32f8c917fe3d46..5ba66906eef2afd8eb1703aef61c9e6f6e3e9ff1 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-24  Micah Cowan  <micah@cowan.name>
+
+       * ftp-ls.c (ftp_index): Don't assume time_t* is compatible with
+       long*. Fixes crash on Windows, and probably other systems.
+
 2008-06-22  Steven Schubiger  <stsc@members.fsf.org>
 
        * http.c: Explicitly initialize and deallocate the message
 2008-06-22  Steven Schubiger  <stsc@members.fsf.org>
 
        * http.c: Explicitly initialize and deallocate the message
index e050c5a25460a5444a032e0eaa83a6f1daff8f02..409996c350d2ad2f9e25e030e03b16558b4b9be9 100644 (file)
@@ -894,7 +894,8 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
             "Jan", "Feb", "Mar", "Apr", "May", "Jun",
             "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
           };
             "Jan", "Feb", "Mar", "Apr", "May", "Jun",
             "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
           };
-          struct tm *ptm = localtime ((time_t *)&f->tstamp);
+          time_t tstamp = f->tstamp;
+          struct tm *ptm = localtime (&tstamp);
 
           fprintf (fp, "%d %s %02d ", ptm->tm_year + 1900, months[ptm->tm_mon],
                   ptm->tm_mday);
 
           fprintf (fp, "%d %s %02d ", ptm->tm_year + 1900, months[ptm->tm_mon],
                   ptm->tm_mday);