https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ccc52d2e5b6c5c3037942…
commit ccc52d2e5b6c5c303794216fa578eebb83589fd3
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Nov 30 15:10:10 2019 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Nov 30 15:10:10 2019 +0900
[KERNEL32] Fix multibyte conversion in default char (#2111)
Fix kernel32!MultiByteToWideChar function. The default character was wrong.
CORE-16468
---
dll/win32/kernel32/winnls/string/nls.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/dll/win32/kernel32/winnls/string/nls.c
b/dll/win32/kernel32/winnls/string/nls.c
index c6d5372dc38..712545f6da4 100644
--- a/dll/win32/kernel32/winnls/string/nls.c
+++ b/dll/win32/kernel32/winnls/string/nls.c
@@ -654,14 +654,9 @@ IntMultiByteToWideCharCP(UINT CodePage,
continue;
}
- if (MultiByteString == MbsEnd)
+ if (MultiByteString == MbsEnd || *MultiByteString == 0)
{
- *WideCharString++ = MultiByteTable[Char];
- }
- else if (*MultiByteString == 0)
- {
- *WideCharString++ = UNICODE_NULL;
- MultiByteString++;
+ *WideCharString++ = CodePageTable->UniDefaultChar;
}
else
{