Commit f4ddd319 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

ucrtbase: Asctime() uses space-padding for day of month as seen in C89.

parent 8b10fb87
......@@ -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;
}
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment