Skip to content

Commit 90cced9

Browse files
committed
input string in remove_ansi_escape_seq is not ended by zero as I expected, so the zero should be pushed on the end of string explicitly every time. It is safe, because output string is shorter
1 parent 480d5f2 commit 90cced9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/table.c

+2-6
Original file line numberDiff line numberDiff line change
@@ -636,24 +636,20 @@ remove_ansi_escape_seq(char *line, ssize_t bytes)
636636
break;
637637
}
638638
else
639-
{
640639
/* broken ascii escape sequence or end of line? */
641-
*writeptr++ = '\0';
642640
goto finish_deescape;
643-
}
644641
}
645642
}
646643
}
647644
else
648-
{
649-
*writeptr++ = '\0';
650645
break;
651-
}
652646
}
653647
}
654648

655649
finish_deescape:
656650

651+
*writeptr++ = '\0';
652+
657653
return writeptr - line;
658654
}
659655

0 commit comments

Comments
 (0)