]> git.saurik.com Git - wxWidgets.git/commitdiff
don't look beyond the end of the string if it ends with a backslash in FilterInEntryN...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 20 Jan 2006 00:55:17 +0000 (00:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 20 Jan 2006 00:55:17 +0000 (00:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/fileconf.cpp

index c70e7e5a5c457436e1f8479914ef157d59aa6928..70676fa8edd70456ff60d5878440da68bc7709e1 100644 (file)
@@ -2030,8 +2030,11 @@ static wxString FilterInEntryName(const wxString& str)
   strResult.Alloc(str.Len());
 
   for ( const wxChar *pc = str.c_str(); *pc != '\0'; pc++ ) {
-    if ( *pc == wxT('\\') )
-      pc++;
+    if ( *pc == wxT('\\') ) {
+      // we need to test it here or we'd skip past the NUL in the loop line
+      if ( *++pc == _T('\0') )
+        break;
+    }
 
     strResult += *pc;
   }