Commit 7efd0c2c authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Return error in mbstowcs if conversion fails.

parent 5310f969
......@@ -2266,6 +2266,11 @@ MSVCRT_size_t CDECL MSVCRT__mbstowcs_l(MSVCRT_wchar_t *wcstr, const char *mbstr,
size = MultiByteToWideChar(locinfo->lc_codepage, 0,
mbstr, size, wcstr, count);
if(!size) {
if(count) wcstr[0] = '\0';
*MSVCRT__errno() = MSVCRT_EILSEQ;
return -1;
}
if(size<count && wcstr)
wcstr[size] = '\0';
......
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