Skip to content

Commit dc10789

Browse files
committed
Fix logging code to not sign extend chars being printed in hex.
1 parent 3cf7456 commit dc10789

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rt/rust_shape.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ log::walk_string2(const std::pair<ptr,ptr> &data) {
394394
if (isprint(ch)) {
395395
out << ch;
396396
} else if (ch) {
397-
out << "\\x" << std::setw(2) << std::setfill('0') << (int)ch;
397+
out << "\\x" << std::setw(2) << std::setfill('0')
398+
<< (unsigned int)(unsigned char)ch;
398399
}
399400
}
400401
++subdp;

0 commit comments

Comments
 (0)