Skip to content

Commit

Permalink
Stop printing 03d after escaped characters in logs (#18030) (#18034)
Browse files Browse the repository at this point in the history
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 <art27@cantab.net>
  • Loading branch information
zeripath authored Dec 19, 2021
1 parent c69b3b6 commit 48bd542
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/log/colors.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ normalLoop:
}

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

0 comments on commit 48bd542

Please sign in to comment.