X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=stat.c;h=3c72a6cd8a140b5fe0b81cb9d65d7dc1329a2dfb;hp=c9148ad7a73b321b08751353326e453581fbac59;hb=1d272416412b0c867224a2b667e6b6124cbc26e8;hpb=1f086b55e7480b0926177576f36813b8b9eb4a61 diff --git a/stat.c b/stat.c index c9148ad7..3c72a6cd 100644 --- a/stat.c +++ b/stat.c @@ -1650,7 +1650,8 @@ 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 (time_buf[strlen(time_buf) - 1] == '\n') + time_buf[strlen(time_buf) - 1] = '\0'; root = json_create_object(); json_object_add_value_string(root, "fio version", fio_version_string);