crush compiler warnings and handle out of memory errors slightly better
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29819 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1133,12 +1133,16 @@ wxString::wxString(const char *psz, wxMBConv& conv, size_t nLength)
|
||||
size_t nActualLength = wxWcstr(buffer, psz, nLen, conv);
|
||||
|
||||
if ( !Alloc(nActualLength + 1) )
|
||||
{
|
||||
wxFAIL_MSG(wxT("Out of memory in wxString"));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//Copy the data
|
||||
assign(buffer.data(), nActualLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Convert wxString in Unicode mode to a multi-byte string
|
||||
const wxCharBuffer wxString::mb_str(wxMBConv& conv) const
|
||||
@@ -1198,12 +1202,16 @@ wxString::wxString(const wchar_t *pwz, wxMBConv& conv, size_t nLength)
|
||||
size_t nActualLength = wxMbstr(buffer, pwz, nLen, conv);
|
||||
|
||||
if ( !Alloc(nActualLength + 1) )
|
||||
{
|
||||
wxFAIL_MSG(wxT("Out of memory in wxString"));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//copy the data
|
||||
assign(buffer.data(), nActualLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Converts this string to a wide character string if unicode
|
||||
//mode is not enabled and wxUSE_WCHAR_T is enabled
|
||||
|
Reference in New Issue
Block a user