From b11dd16306b272d16fa69721584cd1e57b524c5f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 11 Nov 2004 19:01:53 +0000 Subject: [PATCH] fix reading beyond the end of the string if the last string character is a backslash (patch 1059846; bug 1059848) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/config.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index 4cc55702a7..30ca1fa2e7 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -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; -- 2.45.2