]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Test 573: Use correct type for CURLINFO_CONNECT_TIME
authorTor Arntsen <tor@spacetec.no>
Thu, 20 May 2010 14:33:29 +0000 (16:33 +0200)
committerKamil Dudka <kdudka@redhat.com>
Thu, 20 May 2010 15:12:53 +0000 (17:12 +0200)
curl_easy_getinfo() called with a pointer to long instead of double
would sigbus on RISC processors (e.g. MIPS) due to wrong alignment
of pointer address.

tests/libtest/lib573.c

index e08b6df46bf95c514351ad08ab3bc10bcb3f68fc..db5889e3485573aec5d75c19f39363b132189ae7 100644 (file)
@@ -25,7 +25,7 @@ int test(char *URL)
   CURLM *m = NULL;
   int res = 0;
   int running=1;
-  long connect_time = 0;
+  double connect_time = 0.0;
   struct timeval mp_start;
   char mp_timedout = FALSE;
 
@@ -83,8 +83,8 @@ int test(char *URL)
   }
 
   curl_easy_getinfo(c, CURLINFO_CONNECT_TIME, &connect_time);
-  if (connect_time==0) {
-    fprintf(stderr, "connect time is 0\n");
+  if (connect_time==0.0) {
+    fprintf(stderr, "connect time is 0.0\n");
     res = TEST_ERR_MAJOR_BAD;
   }