]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
Uncommented listctrl.tex
[wxWidgets.git] / 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 ) {