diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index d30739900c1..5d389bf3686 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -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