Skip to content

Commit

Permalink
internal/logger: fix keysAndValues overflow
Browse files Browse the repository at this point in the history
The limit should not have the "equal" part, since it moves in pairs and the
last element should be n-1 instead of n.

Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
  • Loading branch information
bmeneg committed Jun 14, 2021
1 parent 3cc2d38 commit 0e02d27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (l *logger) SetStdDest(stdout io.Writer, stderr io.Writer) {
// printKeysAndValues prints the keys and valus, as pairs, passed to those
// functions in the way expected by go-retryablehttp LeveledLogger interface
func printKeysAndValues(l *log.Logger, keysAndValues ...interface{}) {
for i := 0; i <= len(keysAndValues)/2; i += 2 {
for i := 0; i < len(keysAndValues)/2; i += 2 {
l.Printf("\t%s = %s\n", keysAndValues[i], keysAndValues[i+1])
}
}
Expand Down

0 comments on commit 0e02d27

Please sign in to comment.