summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-03-17 23:29:10 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-03-17 23:29:57 +0100
commitc2728625c385ee7b5a28fb5c35a59f640134f4bf (patch)
tree5db8ab685d659cc6fcf5487b988ccde79b3c4a96
parentab9dc5ae2a86e42bb087986587e68cefdf76531d (diff)
downloadcurl-bagder/json-time-output.tar.gz
writeout_json: use curl_off_t printf() option for the time outputbagder/json-time-output
Follow-up to: 04c03416e68fd635a15
-rw-r--r--src/tool_writeout_json.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tool_writeout_json.c b/src/tool_writeout_json.c
index 703cbbde8..70235c209 100644
--- a/src/tool_writeout_json.c
+++ b/src/tool_writeout_json.c
@@ -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;