diff options
author | Andrew Pamment <apamment@yandex.com> | 2019-02-09 21:15:44 +1000 |
---|---|---|
committer | Andrew Pamment <apamment@yandex.com> | 2019-02-09 21:15:44 +1000 |
commit | 74cc3e5d8246b9cf7e53acbad98aa83437b986fd (patch) | |
tree | fc54c8bb1b59a506b2b5e71577db1c262773c28a | |
parent | a4da8d8980b7c787cd8ce7b56f4ed8dad896edd1 (diff) |
Fix for marking all messages as read
-rwxr-xr-x[-rw-r--r--] | src/mail_menu.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mail_menu.c b/src/mail_menu.c index b7236d1..47e138e 100644..100755 --- a/src/mail_menu.c +++ b/src/mail_menu.c @@ -3011,6 +3011,7 @@ void msgbase_reset_pointers(int conference, int msgarea, int readm, int msgno) { struct msg_base_t *mb; struct msg_headers *msghs; struct mail_area *ma = get_area(conference, msgarea); + mb = open_message_base(conference, msgarea); if (!mb) { dolog("Unable to open message base"); @@ -3023,7 +3024,11 @@ void msgbase_reset_pointers(int conference, int msgarea, int readm, int msgno) { j = 0; if (msgno == -1 && readm) { - k = get_message_number(msghs, msghs->msg_count - 1); + if (msghs->msg_count > 0) { + k = get_message_number(msghs, msghs->msg_count - 1); + } else { + k = 0; + } } else if (msgno == -1 && !readm) { k = 0; } else { |