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
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/
git checkout 0.1

View File

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