Fix formatting bug in strbuf_toprint() et al

Was printing chars above \x7f as \xffffffhh.
This commit is contained in:
Andrew Bettison 2012-10-03 17:10:57 +09:30
parent ebf2aa83ac
commit 46f81d9d2e

View File

@ -38,7 +38,7 @@ static inline strbuf _toprint(strbuf sb, char c)
else if (c >= ' ' && c <= '~')
strbuf_putc(sb, c);
else
strbuf_sprintf(sb, "\\x%02x", c);
strbuf_sprintf(sb, "\\x%02x", (unsigned char) c);
return sb;
}