]> git.saurik.com Git - wxWidgets.git/commitdiff
fix reading beyond the end of the string if the last string character is a backslash...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 11 Nov 2004 19:01:53 +0000 (19:01 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 11 Nov 2004 19:01:53 +0000 (19:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/config.cpp

index 4cc55702a7926d31e046647e3c4587ff6ed33cd8..30ca1fa2e7cdc0ad71715cf0cbf2b6fddbdd137c 100644 (file)
@@ -384,7 +384,8 @@ wxString wxExpandEnvVars(const wxString& str)
 
       case '\\':
         // backslash can be used to suppress special meaning of % and $
-        if ( n != str.Len() && (str[n + 1] == wxT('%') || str[n + 1] == wxT('$')) ) {
+        if ( n != str.Len() - 1 &&
+                (str[n + 1] == wxT('%') || str[n + 1] == wxT('$')) ) {
           strResult += str[++n];
 
           break;