From db4eeff587892873b657a76ad49ae9eaf43e28a4 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sun, 2 Sep 2018 18:23:47 +1000 Subject: [PATCH] Fix for empty messages --- src/mail_menu.c | 3 +++ utils/magiedit/main.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mail_menu.c b/src/mail_menu.c index d683c67..d6f811d 100644 --- a/src/mail_menu.c +++ b/src/mail_menu.c @@ -954,6 +954,9 @@ void unmangle_ansi(char *body, int len, char **body_out, int *body_len) { if (body[i] == '[') { state = 2; continue; + } else { + state = 0; + continue; } } else if (state == 2) { param_count = 0; diff --git a/utils/magiedit/main.c b/utils/magiedit/main.c index 1476315..3df71a4 100644 --- a/utils/magiedit/main.c +++ b/utils/magiedit/main.c @@ -738,7 +738,7 @@ char *message_editor() { } return return_body; - } else if (ch.chKeyPress != '\n') { + } else if (ch.chKeyPress != '\n' && ch.chKeyPress != 0x1b) { if (position_x >= strlen(line)) { strncat(line, &ch.chKeyPress, 1); } else {