From 1f086b55e7480b0926177576f36813b8b9eb4a61 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 20 Sep 2016 21:57:25 -0600 Subject: [PATCH] os/windows/posix.c: ensure that ctime_r() adds a newline 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 --- os/windows/posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/windows/posix.c b/os/windows/posix.c index 5830e4c4..33881278 100755 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -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; } -- 2.25.1