From d0e992bda89926bd3c4ecfd6deefb0db87a71d8a Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Fri, 17 Jan 2014 22:59:39 -0500 Subject: [PATCH] Fix for quote-escaping in smt2 printer --- src/printer/smt2/smt2_printer.cpp | 5 +++-- 1 file 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; } -- 2.30.2