diff options
Diffstat (limited to 'src/printer')
-rw-r--r-- | src/printer/smt2/smt2_printer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp index 09de0d378..0ca7f323b 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -987,9 +987,10 @@ static void toStream(std::ostream& out, const CommandUnsupported* s) throw() { static void toStream(std::ostream& out, const CommandFailure* s) throw() { string message = s->getMessage(); // escape all double-quotes - size_t pos; - while((pos = message.find('"')) != string::npos) { + size_t pos = 0; + while((pos = message.find('"', pos)) != string::npos) { message = message.replace(pos, 1, "\\\""); + pos += 2; } out << "(error \"" << message << "\")" << endl; } |