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
parent
1a5c3e4501
commit
48d3fbef5c
|
@ -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]});
|
||||
|
|
Loading…
Reference in New Issue