X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7892b9436cc0f60e2dfe07b12a0b8803e123f4f4..19c35fa587f97cf83e2cb28afe76b8db85b36c9f:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index f02faad0da..2bd4e6178f 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "string.h" #endif @@ -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();