Mail listing bug fix

This commit is contained in:
Andrew Pamment 2016-04-10 09:50:58 +10:00
parent ada38b05ef
commit 70a2ced9cf
2 changed files with 17 additions and 13 deletions

View File

@ -12,7 +12,7 @@ If you want to install Magicka BBS, follow these steps.
1. Ensure you have git, c compiler, sqlite-dev and gnu make 1. Ensure you have git, c compiler, sqlite-dev and gnu make
2. Clone the repo `git clone https://github.com/apamment/MagickaBBS` 2. Clone the repo `git clone https://github.com/apamment/MagickaBBS`
2a. This is the master branch, it's recommended to check out the 0.1 branch ***This is the master branch, it's recommended to check out the 0.1 branch***
cd MagickaBBS/ cd MagickaBBS/
git checkout 0.1 git checkout 0.1

View File

@ -1372,6 +1372,8 @@ int mail_menu(int socket, struct user_record *user) {
s_readstring(socket, buffer, 6); s_readstring(socket, buffer, 6);
if (tolower(buffer[0]) == 'q') { if (tolower(buffer[0]) == 'q') {
JAM_CloseMB(jb);
closed = 1;
break; break;
} else if (strlen(buffer) > 0) { } else if (strlen(buffer) > 0) {
z = atoi(buffer); z = atoi(buffer);
@ -1386,6 +1388,7 @@ int mail_menu(int socket, struct user_record *user) {
} }
} }
if (closed == 0) {
sprintf(buffer, "(#) Read Message # (ENTER) Quit\r\n"); sprintf(buffer, "(#) Read Message # (ENTER) Quit\r\n");
s_putstring(socket, buffer); s_putstring(socket, buffer);
s_readstring(socket, buffer, 6); s_readstring(socket, buffer, 6);
@ -1397,10 +1400,11 @@ int mail_menu(int socket, struct user_record *user) {
read_message(socket, user, msghs, z); read_message(socket, user, msghs, z);
} }
} }
}
if (closed == 0) {
JAM_CloseMB(jb); JAM_CloseMB(jb);
} }
}
if (msghs != NULL) { if (msghs != NULL) {
free_message_headers(msghs); free_message_headers(msghs);
} }