From 7afd4aac39bfc89a145aa8aacba145caeaa151ef Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Fri, 22 Apr 2016 16:07:20 +1000 Subject: [PATCH] More tests --- mail_menu.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/mail_menu.c b/mail_menu.c index a554034..72e2aaf 100644 --- a/mail_menu.c +++ b/mail_menu.c @@ -810,7 +810,7 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh chars = 0; s_putstring(socket, "\r\n"); lines++; - if (lines >= 17) { + if (lines == 17) { s_putstring(socket, "Press a key to continue..."); s_getc(socket); lines = 0; @@ -824,8 +824,7 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh strncpy(buffer, &body[ansi], (z - ansi) + 1); buffer[z - ansi + 1] = '\0'; s_putstring(socket, buffer); - } - if (body[z] == 'A') { + } else if (body[z] == 'A') { for (i=0;i= 0) { s_putstring(socket, "\e[1A"); @@ -834,8 +833,7 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh break; } } - } - if (body[z] == 'C') { + } else if (body[z] == 'C') { for (i=0;i= 0) { s_putstring(socket, "\e[1D"); @@ -863,8 +860,10 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh break; } } + } else { + printf("%c\n", body[z]); } - } else if (body[z] != '\n') { + } else { chars++; s_putchar(socket, body[z]); }