Skip to content

Commit 291dfc8

Browse files
author
Iain Patterson
committed
Use WideCharToMultiByte() correctly.
1 parent b3b29f0 commit 291dfc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utf8.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int to_utf8(const wchar_t *utf16, char **utf8, unsigned long *utf8len) {
4848
*utf8 = (char *) HeapAlloc(GetProcessHeap(), 0, size);
4949
if (! *utf8) return 2;
5050

51-
if (! WideCharToMultiByte(CP_UTF8, 0, utf16, -1, (LPSTR) utf8, size, NULL, NULL)) {
51+
if (! WideCharToMultiByte(CP_UTF8, 0, utf16, -1, *utf8, size, NULL, NULL)) {
5252
HeapFree(GetProcessHeap(), 0, *utf8);
5353
*utf8 = 0;
5454
return 3;

0 commit comments

Comments
 (0)