Skip to content

Commit

Permalink
Fix overflow bug (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfisher authored Feb 16, 2023
1 parent 712ef8e commit 0578384
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/envcheckctl/exec_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ func PrintTop(n int, header string, c cluster.Counter) {
return li[i].value > li[j].value
})
log.Println(header)
if n > len(li) {
n = len(li)
}
for _, v := range li[:n] {
log.Printf("- \"%v\"=%d", v.name, v.value)
}
Expand Down

0 comments on commit 0578384

Please sign in to comment.