]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed dereferencing of invalid pointers
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 7 Jul 2007 12:30:27 +0000 (12:30 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 7 Jul 2007 12:30:27 +0000 (12:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/dcbase.cpp
src/html/winpars.cpp

index f42c88530e070a08b9cc46f1e58e263eb8759efc..67f907abca5cf755efba9db91d30fa17ca1a5c47 100644 (file)
@@ -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
 
index 229bdac946ebd25639a0604a6ab4dc375dedf3b8..1769f56c264b6639e0fe9d150e910d30db1dcb51 100644 (file)
@@ -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;