From 3046fd45fabd04e81948880438208e50105b7685 Mon Sep 17 00:00:00 2001 From: Toon Schoenmakers Date: Thu, 13 Nov 2014 15:01:56 +0100 Subject: [PATCH] Let's also pass the size of newStr in his replace method --- src/ccode.cpp | 1 - src/escaper.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ccode.cpp b/src/ccode.cpp index 4613264..280161f 100644 --- a/src/ccode.cpp +++ b/src/ccode.cpp @@ -736,7 +736,6 @@ void CCode::foreach(const Variable *variable, const std::string &key, const std: // end of the block _out << '}' << std::endl; - } /** diff --git a/src/escaper.h b/src/escaper.h index ff164fd..9f84bc0 100644 --- a/src/escaper.h +++ b/src/escaper.h @@ -41,7 +41,7 @@ class Escaper while ((pos = input.find(oldStr, pos)) != std::string::npos) { // Replace that what we were looking for with newStr - input.replace(pos, oldStrLen, newStr); + input.replace(pos, oldStrLen, newStr, newStrLen); pos += newStrLen; } return input;