summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pamment <apamment@yandex.com>2019-02-09 21:19:12 +1000
committerAndrew Pamment <apamment@yandex.com>2019-02-09 21:19:12 +1000
commitb6a88cb6ac090788567e36cc607a1bc7049d7825 (patch)
tree3aec2bcc9daaa90dac357527061526dfad429aac
parent74cc3e5d8246b9cf7e53acbad98aa83437b986fd (diff)
Better fix
-rwxr-xr-xsrc/mail_menu.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/mail_menu.c b/src/mail_menu.c
index 47e138e..b44ebaa 100755
--- a/src/mail_menu.c
+++ b/src/mail_menu.c
@@ -3021,25 +3021,24 @@ void msgbase_reset_pointers(int conference, int msgarea, int readm, int msgno) {
msghs = read_message_headers(conference, msgarea, gUser, 0);
- j = 0;
+ if (msghs != NULL & msghs->msg_count > 0) {
- if (msgno == -1 && readm) {
- if (msghs->msg_count > 0) {
+ j = 0;
+
+ if (msgno == -1 && readm) {
k = get_message_number(msghs, msghs->msg_count - 1);
- } else {
+ } else if (msgno == -1 && !readm) {
k = 0;
- }
- } else if (msgno == -1 && !readm) {
- k = 0;
- } else {
- if (msgno > get_message_number(msghs, msghs->msg_count - 1)) {
- k = get_message_number(msghs, msghs->msg_count - 1);
} else {
- k = msgno;
+ if (msgno > get_message_number(msghs, msghs->msg_count - 1)) {
+ k = get_message_number(msghs, msghs->msg_count - 1);
+ } else {
+ k = msgno;
+ }
}
+
+ write_lasthighread(mb, gUser, k, k);
}
-
- write_lasthighread(mb, gUser, k, k);
close_message_base(mb);
}