Skip to content

Commit 48bd542

Browse files
authored
Stop printing 03d after escaped characters in logs (#18030) (#18034)
Backport #18030 Strangely a weird bug was present in the log escaping code whereby any escaped character would gain 03d - this was due to a mistake in the format string where it should have read %03o but read instead %o03d. This has led to spurious 03d trailing characters on these escaped characters! Signed-off-by: Andrew Thornton <[email protected]>
1 parent c69b3b6 commit 48bd542

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/log/colors.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ normalLoop:
259259
}
260260

261261
// Process naughty character
262-
if _, err := fmt.Fprintf(c.w, `\%#o03d`, bytes[i]); err != nil {
262+
if _, err := fmt.Fprintf(c.w, `\%#03o`, bytes[i]); err != nil {
263263
return totalWritten, err
264264
}
265265
i++

0 commit comments

Comments
 (0)