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
+2 -2
View File
@@ -250,8 +250,8 @@ private:
void expectFormat(AstNode* nodep, const string& format, AstNode* argp, bool isScan) {
// Check display arguments
bool inPct = false;
for (const char* inp = format.c_str(); *inp; inp++) {
char ch = tolower(*inp); // Breaks with iterators...
for (string::const_iterator it = format.begin(); it != format.end(); ++it) {
char ch = tolower(*it);
if (!inPct && ch=='%') {
inPct = true;
} else if (inPct) {