testcase: echo "" | less, then press ')' key
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
{
unsigned i;
- if (strchr(flines[cur_fline], bracket) == NULL) {
+ if (cur_fline >= max_fline
+ || strchr(flines[cur_fline], bracket) == NULL
+ ) {
print_statusline("No bracket in top line");
return;
}
{
int i;
- if (strchr(flines[cur_fline + max_displayed_line], bracket) == NULL) {
+ if (cur_fline + max_displayed_line >= max_fline
+ || strchr(flines[cur_fline + max_displayed_line], bracket) == NULL
+ ) {
print_statusline("No bracket in bottom line");
return;
}