Fix a bug with backspace

This commit is contained in:
Andrew Pamment 2017-09-10 20:22:56 +10:00
parent e83c4d36fb
commit e7acf16095

View File

@ -421,7 +421,7 @@ char *message_editor() {
od_set_cursor(i - top_of_screen + 5, 1); od_set_cursor(i - top_of_screen + 5, 1);
od_clr_line(); od_clr_line();
} }
} else { } else if (position_x > 0) {
if (position_x >= strlen(line)) { if (position_x >= strlen(line)) {
strncpy(line_cpy, line, strlen(line) - 1); strncpy(line_cpy, line, strlen(line) - 1);
line_cpy[strlen(line) - 1] = '\0'; line_cpy[strlen(line) - 1] = '\0';