libwinpr-crt: add extra null-terminator for ConvertFromUnicode.
This commit is contained in:
parent
ecd9136ca8
commit
b3d34f62dc
@ -341,7 +341,10 @@ int ConvertFromUnicode(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int
|
||||
allocate = TRUE;
|
||||
|
||||
if (allocate)
|
||||
*lpMultiByteStr = (LPSTR) malloc(cbMultiByte);
|
||||
{
|
||||
*lpMultiByteStr = (LPSTR) malloc(cbMultiByte + 1);
|
||||
ZeroMemory(*lpMultiByteStr, cbMultiByte + 1);
|
||||
}
|
||||
|
||||
status = WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar,
|
||||
*lpMultiByteStr, cbMultiByte, lpDefaultChar, lpUsedDefaultChar);
|
||||
|
Loading…
Reference in New Issue
Block a user