msvcrt: Return error in mbstowcs if conversion fails.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5310f9690f
commit
7efd0c2c79
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue