Skip to content
Snippets Groups Projects
Commit 7efd0c2c authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard
Browse files

msvcrt: Return error in mbstowcs if conversion fails.

parent 5310f969
Branches
Tags
No related merge requests found
......@@ -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';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment