From 23b8c4df1910832dd409f6c8cc8906ac64be4279 Mon Sep 17 00:00:00 2001 From: Akihiro Sagawa Date: Wed, 27 Mar 2013 23:16:44 +0900 Subject: [PATCH] msvcrt: Fix mbtowc_l in C locale. --- dlls/msvcrt/mbcs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 121edbb48c6..fdc5422c64a 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -2016,7 +2016,9 @@ int CDECL MSVCRT_mbtowc_l(MSVCRT_wchar_t *dst, const char* str, MSVCRT_size_t n, if(n <= 0 || !str) return 0; - if(!MultiByteToWideChar(locinfo->lc_codepage, 0, str, n, &tmpdst, 1)) + if(!locinfo->lc_codepage) + tmpdst = (unsigned char)*str; + else if(!MultiByteToWideChar(locinfo->lc_codepage, 0, str, n, &tmpdst, 1)) return -1; if(dst) *dst = tmpdst;