From: Vadim Zeitlin Date: Thu, 20 Nov 2008 18:19:17 +0000 (+0000) Subject: fix substr() calls broken by r56215 (#10198) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9c39f4f538b97bc595c31770947a49705e08aaf0?hp=5513d18ba7e0b90b31f993bceb875984c1542cac fix substr() calls broken by r56215 (#10198) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/xml/xml.cpp b/src/xml/xml.cpp index 0193e5a859..1555d29b72 100644 --- a/src/xml/xml.cpp +++ b/src/xml/xml.cpp @@ -825,10 +825,11 @@ bool OutputStringEnt(wxOutputStream& stream, { wxChar c = str.GetChar(i); if (c == wxS('<') || c == wxS('>') || - (c == wxS('&') && str.Mid(i+1, 4) != wxS("amp;")) || + (c == wxS('&') && str.substr(i+1, 4) != wxS("amp;")) || ((flags & XML_ESCAPE_QUOTES) && c == wxS('"'))) { - if ( !OutputString(stream, str.substr(last, i), convMem, convFile) ) + if ( !OutputString(stream, str.substr(last, i - last), + convMem, convFile) ) return false; const char *escaped; @@ -858,7 +859,7 @@ bool OutputStringEnt(wxOutputStream& stream, } } - return OutputString(stream, str.substr(last, i), convMem, convFile); + return OutputString(stream, str.substr(last, i - last), convMem, convFile); } bool OutputIndentation(wxOutputStream& stream,