aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Steven Schubiger <stsc@refcnt.org> 2013-02-08 15:42:21 +0100
committerGravatar Steven Schubiger <stsc@refcnt.org> 2013-02-08 15:42:21 +0100
commitc74f8bccc71a60b69115bc3a54f68daab139de9b (patch)
treeac83369f6eb59e772434bdbba35abd5b61bcc881
parent5b543402df3ecb2e5c5cb973ee4951d22f9cd52c (diff)
downloadcolorize-c74f8bccc71a60b69115bc3a54f68daab139de9b.tar.gz
colorize-c74f8bccc71a60b69115bc3a54f68daab139de9b.tar.bz2
Skip invalid sequences correctly
-rw-r--r--colorize.c3
1 files changed, 2 insertions, 1 deletions
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)