git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26702
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
// now do the actual conversion
wxWCharBuffer buf(nLen);
{
// now do the actual conversion
wxWCharBuffer buf(nLen);
- MB2WC(buf.data(), psz, nLen + 1); // with the trailing NUL
-
- return buf;
+ nLen = MB2WC(buf.data(), psz, nLen + 1); // with the trailing NULL
+ if ( nLen != (size_t)-1 )
+ {
+ return buf;
+ }
if ( nLen != (size_t)-1 )
{
wxCharBuffer buf(nLen+3); // space for a wxUint32 trailing zero
if ( nLen != (size_t)-1 )
{
wxCharBuffer buf(nLen+3); // space for a wxUint32 trailing zero
- WC2MB(buf.data(), pwz, nLen + 4);
-
- return buf;
+ nLen = WC2MB(buf.data(), pwz, nLen + 4);
+ if ( nLen != (size_t)-1 )
+ {
+ return buf;
+ }