Attempt to fix crashes in magiedit

This commit is contained in:
Andrew Pamment 2017-09-10 13:17:51 +10:00
parent 2dcb07ebbf
commit 85e59a64a3

View File

@ -176,7 +176,7 @@ char *message_editor() {
if (ch.chKeyPress == 27) { if (ch.chKeyPress == 27) {
// got an escape that i shouldnt have // got an escape that i shouldnt have
stage = 1; stage = 1;
} else */if (ch.chKeyPress == '\r' || (strlen(line) >= 73 && ch.chKeyPress != '\b')) { } else */if (ch.chKeyPress == '\r' || (strlen(line) >= 73 && ch.chKeyPress > 31 && ch.chKeyPress != 127)) {
if (strlen(line) >= 73 && ch.chKeyPress != '\r') { if (strlen(line) >= 73 && ch.chKeyPress != '\r') {
if (position_x == strlen(line)) { if (position_x == strlen(line)) {
strncat(line, &ch.chKeyPress, 1); strncat(line, &ch.chKeyPress, 1);