properly NUL-terminate the output in wxMBConvUTF16swap::WC2MB()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -991,8 +991,11 @@ size_t wxMBConvUTF16swap::WC2MB(char *buf, const wchar_t *psz, size_t n) const
|
||||
psz++;
|
||||
}
|
||||
|
||||
if ( buf && len < n )
|
||||
*buf = '\0';
|
||||
if ( buf && len < n - 1 )
|
||||
{
|
||||
buf[0] =
|
||||
buf[1] = '\0';
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
Reference in New Issue
Block a user