]> git.saurik.com Git - wxWidgets.git/commitdiff
another assert added to check incorrect use of ctor
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 2 Feb 2000 17:06:50 +0000 (17:06 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 2 Feb 2000 17:06:50 +0000 (17:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/string.cpp

index 559bf3311f664b16777add6d36bf1c66faad9f86..3f8cfe19fd3f990a112a267bf773fe46688b2ae9 100644 (file)
@@ -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 ) {