mirror of
https://github.com/openziti/ziti.git
synced 2026-10-13 07:41:17 +00:00
Fix paging output when using 'limit none'. Was showing large negative number. Fixes GH-147
This commit is contained in:
@@ -137,7 +137,7 @@ func (p *paging) output(o *commonOptions) {
|
||||
} else {
|
||||
first := p.offset + 1
|
||||
last := p.offset + p.limit
|
||||
if last > p.count {
|
||||
if last > p.count || last < 0 { // if p.limit is maxint, last will rollover and be negative
|
||||
last = p.count
|
||||
}
|
||||
_, _ = fmt.Fprintf(o.Out, "results: %v-%v of %v\n", first, last, p.count)
|
||||
|
||||
Reference in New Issue
Block a user