]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
writeout_json: use curl_off_t printf() option for the time output
authorDaniel Stenberg <daniel@haxx.se>
Tue, 17 Mar 2020 22:29:10 +0000 (23:29 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 18 Mar 2020 22:31:37 +0000 (23:31 +0100)
Follow-up to: 04c03416e68fd635a15

Closes #5115

src/tool_writeout_json.c

index 703cbbde87707abbb97bdaf5016a2e859ced352c..70235c20912f4b7bdce7f245d5f25a2e0b744432 100644 (file)
@@ -84,7 +84,8 @@ static int writeTime(FILE *str, CURL *curl, const char *key, CURLINFO ci)
   if(CURLE_OK == curl_easy_getinfo(curl, ci, &val)) {
     curl_off_t s = val / 1000000l;
     curl_off_t ms = val % 1000000l;
-    fprintf(str, "\"%s\":%ld.%06ld", key, s, ms);
+    fprintf(str, "\"%s\":%" CURL_FORMAT_CURL_OFF_T
+            ".%06" CURL_FORMAT_CURL_OFF_T, key, s, ms);
     return 1;
   }
   return 0;