From c74f8bccc71a60b69115bc3a54f68daab139de9b Mon Sep 17 00:00:00 2001 From: Steven Schubiger Date: Fri, 8 Feb 2013 15:42:21 +0100 Subject: Skip invalid sequences correctly --- colorize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/colorize.c b/colorize.c index 661a550..0c0d10e 100644 --- a/colorize.c +++ b/colorize.c @@ -752,7 +752,7 @@ print_clean (const char *line) char ***offsets = NULL; unsigned int count = 0, i = 0; - for (p = line; *p; p++) + for (p = line; *p;) { /* ESC[ */ if (*p == 27 && *(p + 1) == '[') @@ -810,6 +810,7 @@ print_clean (const char *line) DISCARD: continue; } + p++; } if (offsets) -- cgit v1.2.3