os/windows/posix.c: ensure that ctime_r() adds a newline
authorJens Axboe <axboe@fb.com>
Wed, 21 Sep 2016 03:57:25 +0000 (21:57 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 21 Sep 2016 03:57:25 +0000 (21:57 -0600)
The normal POSIX versions do that. And as fio proper strips the
newline, we end up losing the last digit if the Windows version
does not add the newline.

Signed-off-by: Jens Axboe <axboe@fb.com>
os/windows/posix.c

index 5830e4c4edab4cd7bee764873fb9aafa61de3fdf..3388127821acadc5d4053689f1246efd3be96af3 100755 (executable)
@@ -250,7 +250,7 @@ char* ctime_r(const time_t *t, char *buf)
 
     Time_tToSystemTime(*t, &systime);
     /* We don't know how long `buf` is, but assume it's rounded up from the minimum of 25 to 32 */
-    StringCchPrintfA(buf, 31, "%s %s %d %02d:%02d:%02d %04d", dayOfWeek[systime.wDayOfWeek % 7], monthOfYear[(systime.wMonth - 1) % 12],
+    StringCchPrintfA(buf, 31, "%s %s %d %02d:%02d:%02d %04d\n", dayOfWeek[systime.wDayOfWeek % 7], monthOfYear[(systime.wMonth - 1) % 12],
                                                                                 systime.wDay, systime.wHour, systime.wMinute, systime.wSecond, systime.wYear);
     return buf;
 }