diff options
Diffstat (limited to 'tools/perf/util/newt.c')
-rw-r--r-- | tools/perf/util/newt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c index 06f248fde5cf..932f12468c3c 100644 --- a/tools/perf/util/newt.c +++ b/tools/perf/util/newt.c | |||
@@ -491,11 +491,11 @@ static int ui_browser__run(struct ui_browser *self, struct newtExitStruct *es) | |||
491 | break; | 491 | break; |
492 | case NEWT_KEY_END: | 492 | case NEWT_KEY_END: |
493 | offset = self->height - 1; | 493 | offset = self->height - 1; |
494 | if (offset >= self->nr_entries) | ||
495 | offset = self->nr_entries - 1; | ||
494 | 496 | ||
495 | if (offset > self->nr_entries) | 497 | self->index = self->nr_entries - 1; |
496 | offset = self->nr_entries; | 498 | self->first_visible_entry_idx = self->index - offset; |
497 | |||
498 | self->index = self->first_visible_entry_idx = self->nr_entries - 1 - offset; | ||
499 | self->seek(self, -offset, SEEK_END); | 499 | self->seek(self, -offset, SEEK_END); |
500 | break; | 500 | break; |
501 | case NEWT_KEY_RIGHT: | 501 | case NEWT_KEY_RIGHT: |