diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c index 32e264908ae..7d9b46b3e6f 100644 --- a/dlls/msvcrt/tests/string.c +++ b/dlls/msvcrt/tests/string.c @@ -2300,7 +2300,7 @@ static void test__wcstombs_s_l(void) { L"text", _TRUNCATE, "", 1, 1, STRUNCATE, NULL, FALSE, TRUE }, { L"text", 5, "", 3, 0, ERANGE, NULL, TRUE }, - { L"", 0, NULL, 0, 1, 0, "English_United States.1252", TRUE, TRUE }, + { L"", 0, NULL, 0, 1, 0, "English_United States.1252" }, { L"\xfffd", 1, NULL, 0, 0, EILSEQ, "English_United States.1252", TRUE }, { L"\xfffd", 1, "", 1, 0, EILSEQ, "English_United States.1252", TRUE }, { L"\xfffd", 1, "", 6, 0, EILSEQ, "English_United States.1252", TRUE }, diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 84110482046..64bc1f83d47 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -459,12 +459,12 @@ static MSVCRT_size_t MSVCRT_wcsrtombs_l(char *mbstr, const MSVCRT_wchar_t **wcst if(!mbstr) { tmp = WideCharToMultiByte(locinfo->lc_codepage, WC_NO_BEST_FIT_CHARS, - *wcstr, -1, NULL, 0, NULL, &used_default)-1; + *wcstr, -1, NULL, 0, NULL, &used_default); if(!tmp || used_default) { *MSVCRT__errno() = MSVCRT_EILSEQ; return -1; } - return tmp; + return tmp-1; } while(**wcstr) {