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
This commit is contained in:
Vadim Zeitlin
2000-02-02 17:06:50 +00:00
parent 7e99ad8621
commit 6c68273f97

View File

@@ -290,11 +290,11 @@ void wxString::InitWith(const wxChar *psz, size_t nPos, size_t nLength)
{ {
Init(); Init();
wxASSERT( nPos <= wxStrlen(psz) );
if ( nLength == wxSTRING_MAXLEN ) if ( nLength == wxSTRING_MAXLEN )
nLength = wxStrlen(psz + nPos); nLength = wxStrlen(psz + nPos);
wxASSERT_MSG( nPos + nLength <= wxStrlen(psz), _T("index out of bounds") );
STATISTICS_ADD(InitialLength, nLength); STATISTICS_ADD(InitialLength, nLength);
if ( nLength > 0 ) { if ( nLength > 0 ) {