mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06: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();
|
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,
|
||||||
|
Loading…
Reference in New Issue
Block a user