std/fmt/index.zig: set width from 0 to 2;

\x00 was printed as 0 and \x0E was printed as E;
\x00 now correctly prints 00 and \x0E correctly prints 0E;
master
kristopher tate 2018-09-02 15:04:20 +09:00
parent 1a5c3e4501
commit 48d3fbef5c
1 changed files with 1 additions and 1 deletions

View File

@ -352,7 +352,7 @@ pub fn formatText(
return formatBuf(bytes, width, context, Errors, output);
} else if ((fmt[0] == 'x') or (fmt[0] == 'X') ) {
for (bytes) |c| {
try formatInt(c, 16, fmt[0] == 'X', 0, context, Errors, output);
try formatInt(c, 16, fmt[0] == 'X', 2, context, Errors, output);
}
return;
} else @compileError("Unknown format character: " ++ []u8{fmt[0]});