From 25242861c71a685b25d388865d6b6e35900a01a7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Mar 2014 09:32:00 +0100 Subject: [PATCH] API: Fixed timeval struct formatting . --- api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api.c b/api.c index 3b0cff47..3188af48 100644 --- a/api.c +++ b/api.c @@ -1005,9 +1005,9 @@ static struct api_data *print_data(struct api_data *root, char *buf, bool isjson sprintf(buf, "%s", *((bool *)(root->data)) ? TRUESTR : FALSESTR); break; case API_TIMEVAL: - snprintf(buf, sizeof(buf), "%ld.%06ld", - (long)((struct timeval *)(root->data))->tv_sec, - (long)((struct timeval *)(root->data))->tv_usec); + snprintf(buf, sizeof(buf), "%"PRIu64".%06lu", + (uint64_t)((struct timeval *)(root->data))->tv_sec, + (unsigned long)((struct timeval *)(root->data))->tv_usec); break; case API_TEMP: sprintf(buf, "%.2f", *((float *)(root->data)));