Returning invalid buffer for empty input is unexpected and resulted in e.g.
wxString::utf8_str() returning NULL and not "" in ANSI build for empty strings
(which, in turn, resulted in crashes in the test suite and undoubtedly not
only) as well as crashes when calling GTK+ functions (see #12432). Other uses
of cMB2WC() also show that NULL return value from it is unexpected as it is
often passed to CRT functions not accepting NULL.
So return empty buffer instead for empty input to avoid all these problems.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65836
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
}
}
- return wxWCharBuffer();
+ return wxScopedWCharBuffer::CreateNonOwned(L"", 0);
}
const wxCharBuffer wxMBConv::cWC2MB(const wxScopedWCharBuffer& wbuf) const
}
}
- return wxCharBuffer();
+ return wxScopedCharBuffer::CreateNonOwned("", 0);
}
// ----------------------------------------------------------------------------