BACKENDS: WIN32: Use calloc to allocate memory for UTF8ToUnicode wrapper.
This commit is contained in:
parent
1612b6845a
commit
4cef06d7a8
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ wchar_t *UTF8ToUnicode(const char *s) {
|
|||
DWORD size = MultiByteToWideChar(CP_UTF8, 0, s, -1, NULL, 0);
|
||||
|
||||
if (size > 0) {
|
||||
LPWSTR result = new WCHAR[size];
|
||||
LPWSTR result = (LPWSTR)calloc(size, sizeof(WCHAR));
|
||||
if (MultiByteToWideChar(CP_UTF8, 0, s, -1, result, size) != 0)
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue