From: Vadim Zeitlin Date: Fri, 8 Aug 2003 11:54:26 +0000 (+0000) Subject: don't ignore start parameter in find_last_of() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/65c75abefc4b06d49421be4af5397d8b3d5647d4 don't ignore start parameter in find_last_of() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22700 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/string.cpp b/src/common/string.cpp index f02faad0da..e15d84319d 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -536,10 +536,11 @@ size_t wxStringBase::find_last_of(const wxChar* sz, size_t nStart) const } else { - wxASSERT( nStart <= length() ); + wxASSERT_MSG( nStart <= length(), + _T("invalid index in find_last_of()") ); } - for ( const wxChar *p = c_str() + length() - 1; p >= c_str(); p-- ) + for ( const wxChar *p = c_str() + nStart - 1; p >= c_str(); p-- ) { if ( wxStrchr(sz, *p) ) return p - c_str();