json ouput is striping the last character of the year on Windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Windows the year is not correct when using JSON output.

  "time" : "Mon Sep 19 17:21:45 201",

diff --git a/stat.c b/stat.c
index c9148ad..0c64333 100644
--- a/stat.c
+++ b/stat.c
@@ -1650,7 +1650,9 @@ void __show_run_stats(void)
 
                os_ctime_r((const time_t *) &now.tv_sec, time_buf,
                                sizeof(time_buf));
-               time_buf[strlen(time_buf) - 1] = '\0';
+               #if !defined(WIN32) 
+                    time_buf[strlen(time_buf) - 1] = '\0';
+                #endif 
 
                root = json_create_object();
                json_object_add_value_string(root, "fio version", fio_version_string);

I tested this patch on Windows and Linux and got the correct time format for both
  "time" : "Mon Sep 19 21:18:24 2016",
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux