mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
utf16_to_utf8: Allocate space for converted string and NUL
References #6646
This commit is contained in:
@@ -1367,7 +1367,7 @@ int utf16_to_utf8(const WCHAR *strw, char **str)
|
|||||||
return GetLastError();
|
return GetLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
*str = xmalloc(utf8_len);
|
*str = xmallocz(utf8_len);
|
||||||
|
|
||||||
// Convert to UTF-8.
|
// Convert to UTF-8.
|
||||||
utf8_len = WideCharToMultiByte(CP_UTF8,
|
utf8_len = WideCharToMultiByte(CP_UTF8,
|
||||||
|
Reference in New Issue
Block a user