diff --git a/src/ast/ast_smt2_pp.cpp b/src/ast/ast_smt2_pp.cpp index ed634069c..db2043320 100644 --- a/src/ast/ast_smt2_pp.cpp +++ b/src/ast/ast_smt2_pp.cpp @@ -343,7 +343,7 @@ format * smt2_pp_environment::pp_str_literal(app * t) { } else { // general hex escape buf << "\\x"; - unsigned int cVal = (unsigned int)c; + unsigned int cVal = ((unsigned int)c) & 0x000000FF; const char convtable[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; unsigned int highPart = cVal / 16; unsigned int lowPart = cVal % 16;