msvcrt/tests: Fix crash in mbstowcs tests.

This commit is contained in:
Piotr Caban 2014-01-09 17:34:05 +01:00 committed by Alexandre Julliard
parent 8d426f5398
commit 1d4ac6dc1e
1 changed files with 7 additions and 4 deletions

View File

@ -1635,10 +1635,13 @@ static void test_mbstowcs(void)
wOut[4] = '!'; wOut[5] = '\0';
mOut[4] = '!'; mOut[5] = '\0';
errno = 0xdeadbeef;
ret = mbstowcs(wOut, NULL, 4);
ok(ret == -1, "mbstowcs did not return -1\n");
ok(errno == EINVAL, "errno = %d\n", errno);
if(pmbstowcs_s) {
/* crashes on some systems */
errno = 0xdeadbeef;
ret = mbstowcs(wOut, NULL, 4);
ok(ret == -1, "mbstowcs did not return -1\n");
ok(errno == EINVAL, "errno = %d\n", errno);
}
ret = mbstowcs(NULL, mSimple, 0);
ok(ret == 4, "mbstowcs did not return 4\n");