From: Jens Axboe Date: Wed, 21 Sep 2016 03:57:25 +0000 (-0600) Subject: os/windows/posix.c: ensure that ctime_r() adds a newline X-Git-Tag: fio-2.15~38 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=1f086b55e7480b0926177576f36813b8b9eb4a61;ds=inline 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 --- 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; }