diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index b7b76afb317..a2500c48789 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -1349,9 +1349,16 @@ static char* asctime_buf(char *buf, const struct MSVCRT_tm *mstm) return NULL; } +#if _MSVCR_VER>=140 + /* C89 (4.12.3.1) uses space-padding for day of month. */ + MSVCRT__snprintf(buf, 26, "%s %s %2d %02d:%02d:%02d %c%03d\n", wday[mstm->tm_wday], + month[mstm->tm_mon], mstm->tm_mday, mstm->tm_hour, mstm->tm_min, + mstm->tm_sec, '1'+(mstm->tm_year+900)/1000, (900+mstm->tm_year)%1000); +#else MSVCRT__snprintf(buf, 26, "%s %s %02d %02d:%02d:%02d %c%03d\n", wday[mstm->tm_wday], month[mstm->tm_mon], mstm->tm_mday, mstm->tm_hour, mstm->tm_min, mstm->tm_sec, '1'+(mstm->tm_year+900)/1000, (900+mstm->tm_year)%1000); +#endif return buf; } diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index 4a9591002c3..2bb221b84e6 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -762,7 +762,7 @@ static void test_asctime(void) } ret = p_asctime(&epoch); - todo_wine ok(!strcmp(ret, "Thu Jan 1 00:00:00 1970\n"), "asctime returned %s\n", ret); + ok(!strcmp(ret, "Thu Jan 1 00:00:00 1970\n"), "asctime returned %s\n", ret); } START_TEST(misc)