From: Micah Cowan Date: Tue, 24 Jun 2008 18:44:40 +0000 (-0700) Subject: Don't assume time_t* is compatible with long*. X-Git-Tag: v1.13~421^2~3 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=b91e2353f54fb9b281185e85a2821028340cb187 Don't assume time_t* is compatible with long*. --- diff --git a/src/ChangeLog b/src/ChangeLog index 7ed11cb1..5ba66906 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-06-24 Micah Cowan + + * 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 * http.c: Explicitly initialize and deallocate the message diff --git a/src/ftp-ls.c b/src/ftp-ls.c index e050c5a2..409996c3 100644 --- a/src/ftp-ls.c +++ b/src/ftp-ls.c @@ -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" }; - 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);