Skip to content

Commit

Permalink
chunked: use Fprint instead of Fprintf
Browse files Browse the repository at this point in the history
replace Fprintf(file, string) with Fprint(file, string) since
the argument is a raw string and it should not be treated as a
formatting directive.

Closes: containers#1955

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jun 7, 2024
1 parent c923593 commit e6b3330
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/chunked/dump/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func dumpNode(out io.Writer, added map[string]struct{}, links map[string]int, ve
}
}

if _, err := fmt.Fprintf(out, escapedOptional(payload, ESCAPE_LONE_DASH)); err != nil {
if _, err := fmt.Fprint(out, escapedOptional(payload, ESCAPE_LONE_DASH)); err != nil {
return err
}

Expand All @@ -184,7 +184,7 @@ func dumpNode(out io.Writer, added map[string]struct{}, links map[string]int, ve
return err
}
digest := verityDigests[payload]
if _, err := fmt.Fprintf(out, escapedOptional(digest, ESCAPE_LONE_DASH)); err != nil {
if _, err := fmt.Fprint(out, escapedOptional(digest, ESCAPE_LONE_DASH)); err != nil {
return err
}

Expand Down

0 comments on commit e6b3330

Please sign in to comment.