From 6c68273f974d3e5c5ba23ae43ce2d25a100388ff Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 2 Feb 2000 17:06:50 +0000 Subject: [PATCH] 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 --- src/common/string.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ) { -- 2.47.2