From b91e2353f54fb9b281185e85a2821028340cb187 Mon Sep 17 00:00:00 2001 From: Micah Cowan Date: Tue, 24 Jun 2008 11:44:40 -0700 Subject: [PATCH] Don't assume time_t* is compatible with long*. --- src/ChangeLog | 5 +++++ src/ftp-ls.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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);