Fix mystic pi bad ansi crashing magicka

This commit is contained in:
Andrew Pamment 2017-09-08 22:23:17 +10:00
parent 1dfe7cc715
commit 6b212d8e76

View File

@ -881,6 +881,7 @@ void unmangle_ansi(char *body, int len, char **body_out, int *body_len) {
char_at = 1;
for (i=0;i<len;i++) {
if (state == 0) {
if (body[i] == 27) {
state = 1;
@ -943,6 +944,9 @@ void unmangle_ansi(char *body, int len, char **body_out, int *body_len) {
} else {
line_at--;
}
if (line_at < 1) {
line_at = 1;
}
state = 0;
break;
case 'B':