a not-always-correct assert fixed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -290,10 +290,12 @@ void wxString::InitWith(const wxChar *psz, size_t nPos, size_t nLength)
|
||||
{
|
||||
Init();
|
||||
|
||||
if ( nLength == wxSTRING_MAXLEN )
|
||||
nLength = wxStrlen(psz + nPos);
|
||||
// if the length is not given, assume the string to be NUL terminated
|
||||
if ( nLength == wxSTRING_MAXLEN ) {
|
||||
wxASSERT_MSG( nPos <= wxStrlen(psz), _T("index out of bounds") );
|
||||
|
||||
wxASSERT_MSG( nPos + nLength <= wxStrlen(psz), _T("index out of bounds") );
|
||||
nLength = wxStrlen(psz + nPos);
|
||||
}
|
||||
|
||||
STATISTICS_ADD(InitialLength, nLength);
|
||||
|
||||
|
Reference in New Issue
Block a user