Fix string corruption, bug780.

This commit is contained in:
Wilson Snyder
2014-06-08 21:36:18 -04:00
parent 69468708e2
commit 6cf50e6579
23 changed files with 126 additions and 88 deletions
+3 -2
View File
@@ -1696,8 +1696,9 @@ private:
string fmt = "";
bool inPct = false;
AstNode* argp = nodep->exprsp();
for (const char* inp = nodep->text().c_str(); *inp; inp++) {
char ch = *inp; // Breaks with iterators...
string text = nodep->text();
for (string::const_iterator it = text.begin(); it!=text.end(); ++it) {
char ch = *it;
if (!inPct && ch=='%') {
inPct = true;
fmt = ch;