X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f06a017120fd765296f7e8cde414edea64153a9..b922ef5a1b45210afe8c6a7ea131826fb99fb9a4:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 559bf3311f..3f8cfe19fd 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -290,11 +290,11 @@ void wxString::InitWith(const wxChar *psz, size_t nPos, size_t nLength) { Init(); - wxASSERT( nPos <= wxStrlen(psz) ); - if ( nLength == wxSTRING_MAXLEN ) nLength = wxStrlen(psz + nPos); + wxASSERT_MSG( nPos + nLength <= wxStrlen(psz), _T("index out of bounds") ); + STATISTICS_ADD(InitialLength, nLength); if ( nLength > 0 ) {