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);