]> git.refcnt.org Git - colorize.git/commitdiff
Skip invalid sequences correctly
authorSteven Schubiger <stsc@refcnt.org>
Fri, 8 Feb 2013 14:42:21 +0000 (15:42 +0100)
committerSteven Schubiger <stsc@refcnt.org>
Fri, 8 Feb 2013 14:42:21 +0000 (15:42 +0100)
colorize.c

index 661a550e08952b1b26aae2604144e696f798a5b6..0c0d10e1657cf857278ea81229534ed94e1dac09 100644 (file)
@@ -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)