BACKENDS: WIN32: Use calloc to allocate memory for UTF8ToUnicode wrapper.

This commit is contained in:
aryanrawlani28 2020-08-21 21:04:26 +05:30 committed by Eugene Sandulenko
parent 1612b6845a
commit 4cef06d7a8

View file

@ -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;
}