aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-04-11 10:49:51 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-04-11 10:49:51 +0000
commitdeeb74b7e4049cd3d25c02d9c5e5f74394567362 (patch)
treeeecd73fa1560867e6f59e71a93ce6cd90daed249 /src
parent0542002d7a52b45c29db35d4ca439f927ce386ac (diff)
#1468330 (http://curl.haxx.se/bug/view.cgi?id=1468330) pointed out a bad
typecast in the curl tool leading to a crash with (64bit?) VS2005 (at least) since the struct timeval field tv_sec is an int while time_t is 64bit.
Diffstat (limited to 'src')
-rw-r--r--src/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 4a1cec378..5b17e4f41 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3078,11 +3078,13 @@ int my_trace(CURL *handle, curl_infotype type,
struct timeval tv;
struct tm *now;
char timebuf[20];
+ time_t secs;
(void)handle; /* prevent compiler warning */
tv = curlx_tvnow();
- now = localtime((time_t *)&tv.tv_sec); /* not multithread safe but we don't care */
+ secs = tv.tv_sec;
+ now = localtime(&secs); /* not multithread safe but we don't care */
if(config->tracetime)
snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06d ",
now->tm_hour, now->tm_min, now->tm_sec, tv.tv_usec);