From: Václav Slavík Date: Sat, 7 Jul 2007 12:30:27 +0000 (+0000) Subject: fixed dereferencing of invalid pointers X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f5595af61ed87fec9bd5dd7f62c66089bd90bc57 fixed dereferencing of invalid pointers git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index f42c88530e..67f907abca 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -2302,7 +2302,7 @@ void wxDCBase::DrawLabel(const wxString& text, wxString curLine; for ( wxString::const_iterator pc = text.begin(); ; ++pc ) { - if ( *pc == _T('\n') || pc == text.end() ) + if ( pc == text.end() || *pc == _T('\n') ) { int xRealStart = x; // init it here to avoid compielr warnings diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index 229bdac946..1769f56c26 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -379,7 +379,7 @@ void wxHtmlWinParser::AddText(const wxString& txt) ++i, ++x; while ( (i < end) && (*i == wxT('\n') || *i == wxT('\r') || - *i == wxT(' ')) || *i == wxT('\t') ) + *i == wxT(' ') || *i == wxT('\t')) ) { ++i; ++x;