git://git.iain.cx/iain
/
nssm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b3b29f0
)
Use WideCharToMultiByte() correctly.
author
Iain Patterson
<me@iain.cx>
Wed, 17 Aug 2016 11:23:44 +0000
(12:23 +0100)
committer
Iain Patterson
<me@iain.cx>
Fri, 26 Aug 2016 07:53:52 +0000
(08:53 +0100)
utf8.cpp
patch
|
blob
|
history
diff --git
a/utf8.cpp
b/utf8.cpp
index
3f71bd7
..
ba451e0
100644
(file)
--- a/
utf8.cpp
+++ b/
utf8.cpp
@@
-48,7
+48,7
@@
int to_utf8(const wchar_t *utf16, char **utf8, unsigned long *utf8len) {
*utf8 = (char *) HeapAlloc(GetProcessHeap(), 0, size);
\r
if (! *utf8) return 2;
\r
\r
- if (! WideCharToMultiByte(CP_UTF8, 0, utf16, -1,
(LPSTR)
utf8, size, NULL, NULL)) {
\r
+ if (! WideCharToMultiByte(CP_UTF8, 0, utf16, -1,
*
utf8, size, NULL, NULL)) {
\r
HeapFree(GetProcessHeap(), 0, *utf8);
\r
*utf8 = 0;
\r
return 3;
\r