From f091d9edf652eb2b45d8042c598addd7d0ef4d2c Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Tue, 14 Jun 2016 11:57:16 +0200 Subject: [PATCH] msvcrt: Fix C locale handling in mbstowcs. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/mbcs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 5d389bf3686..fe88cc7cadc 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -2253,6 +2253,17 @@ MSVCRT_size_t CDECL MSVCRT__mbstowcs_l(MSVCRT_wchar_t *wcstr, const char *mbstr, else locinfo = locale->locinfo; + if(!locinfo->lc_codepage) { + if(!wcstr) + return strlen(mbstr); + + for(i=0; ilc_codepage, 0, mbstr, -1, NULL, 0)-1;