Skip to content
Snippets Groups Projects
Commit 91bd565a authored by Axel Naumann's avatar Axel Naumann
Browse files

Only print char if printable; else print its hex value.

parent 831dfeca
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,12 @@ static void StreamValue(llvm::raw_ostream& o, const void* const p,
const ValuePrinterInfo& VPI);
static void StreamChar(llvm::raw_ostream& o, const char v) {
o << '"' << v << "\"";
if (isprint(v))
o << '"' << v << "\"";
else {
o << "\\0x";
o.write_hex(v);
}
}
static void StreamCharPtr(llvm::raw_ostream& o, const char* const v) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment