diff --git a/modules/rostests/winetests/msvcrt/misc.c b/modules/rostests/winetests/msvcrt/misc.c index 4a0330a2e2c9f..6747061d31785 100644 --- a/modules/rostests/winetests/msvcrt/misc.c +++ b/modules/rostests/winetests/msvcrt/misc.c @@ -167,6 +167,11 @@ static void test_I10_OUTPUT(void) win_skip("I10_OUTPUT not available\n"); return; } + if (sizeof(long double) == 8) + { + skip("I10_OUTPUT test is broken on MSVC builds!\n"); + return; + } if (j != 12) trace("sizeof(long double) = %d on this machine\n", j); diff --git a/sdk/lib/crt/misc/i10output.c b/sdk/lib/crt/misc/i10output.c index 85e493594e030..3f1accd5219a7 100644 --- a/sdk/lib/crt/misc/i10output.c +++ b/sdk/lib/crt/misc/i10output.c @@ -38,7 +38,7 @@ int CDECL MSVCRT_I10_OUTPUT(_LDOUBLE ld80, int prec, int flag, struct _I10_OUTPU char buf[I10_OUTPUT_MAX_PREC+9]; /* 9 = strlen("0.e+0000") + '\0' */ char *p; - memcpy(&ld, &ld80, 10); + memcpy(&ld, &ld80, min(sizeof(ld80), sizeof(ld))); // This is broken on MSVC builds! d = ld; TRACE("(%lf %d %x %p)\n", d, prec, flag, data);