cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] (Was: 64-bit Irix and AIX)

From: Tor Arntsen <tor_at_spacetec.no>
Date: Thu, 12 Feb 2004 20:15:24 +0100

On Feb 9, 19:05, I wrote:
>For some reason test 141 fails on 64-bit Irix but everything passed on
>64-bit AIX.
[...]

It's dangerous to cast pointers, particularly when working with 64-bits systems.
The following patch fixes the problem with test 141 on SGI/IRIX 64-bit builds.

-Tor

Index: ftp.c
===================================================================
RCS file: /repository/curl/lib/ftp.c,v
retrieving revision 1.225
diff -u -p -r1.225 ftp.c
--- ftp.c 9 Feb 2004 07:52:36 -0000 1.225
+++ ftp.c 12 Feb 2004 19:11:54 -0000
@@ -2238,11 +2238,12 @@ CURLcode ftp_perform(struct connectdata
 #ifdef HAVE_STRFTIME
     if(data->set.get_filetime && (data->info.filetime>=0) ) {
       struct tm *tm;
+ time_t clock = (time_t) data->info.filetime;
 #ifdef HAVE_GMTIME_R
       struct tm buffer;
- tm = (struct tm *)gmtime_r((time_t *)&data->info.filetime, &buffer);
+ tm = (struct tm *)gmtime_r(&clock, &buffer);
 #else
- tm = gmtime((time_t *)&data->info.filetime);
+ tm = gmtime(&clock);
 #endif
       /* format: "Tue, 15 Nov 1994 12:45:26" */
       strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S GMT\r\n",
Received on 2004-02-12