From: Vadim Zeitlin Date: Wed, 2 Feb 2000 17:06:50 +0000 (+0000) Subject: another assert added to check incorrect use of ctor X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6c68273f974d3e5c5ba23ae43ce2d25a100388ff another assert added to check incorrect use of ctor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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 ) {