X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3232da9d90cac87a3d60eadb169e08e3330829a9..079f4130b861d094c79e0952966caad8b85dab67:/src/xml/xml.cpp 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,