]> git.saurik.com Git - wxWidgets.git/commit
Don't return invalid buffer from wxConvertToGTK("").
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 16 Oct 2010 18:10:58 +0000 (18:10 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 16 Oct 2010 18:10:58 +0000 (18:10 +0000)
commitdd5ab30d6a896e961a42fbfabd42c6415a1f388a
tree02f90fc7dca25e70f60df01ac44a97119f6d0a3a
parent817b7b0e87589927983d8723ea2ad3faabbdebd3
Don't return invalid buffer from wxConvertToGTK("").

The result of wxConvertToGTK() is often passed to GTK+ functions directly and
not all of them handle NULLs gracefully, e.g. gtk_editable_insert_text() just
crashes.

Return an empty string from wxConvertToGTK() explicitly for empty string input
to avoid such problems.

Another potential solution might have been to change wxMBConv::cMB2WC() to
return empty buffer instead of invalid one for empty input but it's not clear
if this is not going to break something else.

Closes #12432.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65826 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
src/gtk/utilsgtk.cpp