From 93d5f6237b6a860fe66be0f57c9636a3b031f26d Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 30 Mar 2016 13:04:11 +1000 Subject: [PATCH] Fix for private messages --- mail_menu.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mail_menu.c b/mail_menu.c index fb2cb4b..fd50545 100644 --- a/mail_menu.c +++ b/mail_menu.c @@ -91,6 +91,7 @@ struct msg_headers *read_message_headers(int msgconf, int msgarea, struct user_r int i; int z; int j; + int k; struct fido_addr *dest; struct msg_headers *msghs = NULL; @@ -106,8 +107,8 @@ struct msg_headers *read_message_headers(int msgconf, int msgarea, struct user_r if (jbh.ActiveMsgs > 0) { msghs = (struct msg_headers *)malloc(sizeof(struct msg_headers)); msghs->msg_count = 0; - - for (i=0;msghs->msg_count < jbh.ActiveMsgs;i++) { + k = 0; + for (i=0;k < jbh.ActiveMsgs;i++) { memset(&jmh, 0, sizeof(s_JamMsgHeader)); z = JAM_ReadMsgHeader(jb, i, &jmh, &jsp); @@ -229,6 +230,7 @@ struct msg_headers *read_message_headers(int msgconf, int msgarea, struct user_r free(wwiv_addressee); free(jamm->msg_h); free(jamm); + k++; continue; } free(wwiv_addressee); @@ -241,7 +243,8 @@ struct msg_headers *read_message_headers(int msgconf, int msgarea, struct user_r } msghs->msgs[msghs->msg_count] = jamm; - msghs->msg_count++; + msghs->msg_count++; + k++; } } else { @@ -268,7 +271,7 @@ char *editor(int socket, struct user_record *user, char *quote, char *from) { int qfrom,qto; int z; char *tagline; - + if (quote != NULL) { for (i=0;i