summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pamment <apamment@yandex.com>2018-12-01 13:09:32 +1000
committerAndrew Pamment <apamment@yandex.com>2018-12-01 13:09:32 +1000
commit1bdc63cb7ff761b317f048d00468c9631ec18780 (patch)
treea1562dbb6157e011c8236ceaef22aa863d52fd82
parent8e4a87e58423afe6dcac946fd604688f5b6fb5c8 (diff)
Another attempt...
-rw-r--r--src/mail_menu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mail_menu.c b/src/mail_menu.c
index 4772d9d..04787af 100644
--- a/src/mail_menu.c
+++ b/src/mail_menu.c
@@ -3148,7 +3148,8 @@ int count_msgs_above_msgno(struct msg_headers *msghs, int highmsgno) {
int i;
int highmsg = 0;
- for (i=msghs->msg_count; i>=highmsgno;i--) {
+ for (i=msghs->msg_count-1; i>=0;i--) {
+ if (msghs->msgs[i]->msg_no <= highmsgno) break;
highmsg++;
}
return highmsg;