mirror of
https://github.com/neovim/neovim.git
synced 2024-12-25 13:45:15 -07:00
utf16_to_utf8: Allocate space for converted string and NUL
References #6646
This commit is contained in:
parent
2b3cb2c448
commit
4f75e2f95c
@ -1367,7 +1367,7 @@ int utf16_to_utf8(const WCHAR *strw, char **str)
|
||||
return GetLastError();
|
||||
}
|
||||
|
||||
*str = xmalloc(utf8_len);
|
||||
*str = xmallocz(utf8_len);
|
||||
|
||||
// Convert to UTF-8.
|
||||
utf8_len = WideCharToMultiByte(CP_UTF8,
|
||||
|
Loading…
Reference in New Issue
Block a user