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:
@@ -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 ) {
|
||||||
|
Reference in New Issue
Block a user