Prevent crash in wxString::Mid under STL builds (fixes #1231725).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-07-04 11:12:52 +00:00
parent 31da10deab
commit 73f507f52d

View File

@@ -1414,11 +1414,12 @@ wxString wxString::Mid(size_t nFirst, size_t nCount) const
if ( nFirst > nLen )
{
// AllocCopy() will return empty string
nCount = 0;
return wxEmptyString;
}
wxString dest(*this, nFirst, nCount);
if ( dest.length() != nCount ) {
if ( dest.length() != nCount )
{
wxFAIL_MSG( _T("out of memory in wxString::Mid") );
}