diff options
-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 b743ba70e..4b36b4548 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -960,9 +960,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; } |