Commit 41789724 authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

msvcrt: Don't set error in wcstombs_s_l if no characters to convert.

parent 51b75e9a
......@@ -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 },
......
......@@ -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) {
......
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