fix another WC2MB off-by-one error
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@56402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -259,8 +259,14 @@ selection_handler( GtkWidget *WXUNUSED(widget),
|
||||
{
|
||||
const wchar_t *wstr = (const wchar_t *)d;
|
||||
size_t len = wxConvCurrent->WC2MB(NULL, wstr, 0);
|
||||
if ( len == wxCONV_FAILED )
|
||||
{
|
||||
free(d);
|
||||
return;
|
||||
}
|
||||
|
||||
char *str = malloc(len + 1);
|
||||
wxConvCurrent->WC2MB(str, wstr, len);
|
||||
wxConvCurrent->WC2MB(str, wstr, len + 1);
|
||||
str[len] = '\0';
|
||||
|
||||
free(d);
|
||||
|
Reference in New Issue
Block a user