Use for loop to iterate.
authorFreeBirdLjj <ljj11011@mail.ustc.edu.cn>
Mon, 29 Sep 2014 06:02:59 +0000 (14:02 +0800)
committerFreeBirdLjj <ljj11011@mail.ustc.edu.cn>
Mon, 29 Sep 2014 06:02:59 +0000 (14:02 +0800)
src/viewer.c

index 5413183..40e4bd7 100644 (file)
@@ -519,7 +519,7 @@ void inline_display(WINDOW *window, const char *c, const int colors) {
     cstack_t *stack = cstack_init();
 
     // for each char in line
-    while(*c) {
+    for(; *c; c++) {
 
         // if char is in special char list
         if(strchr(special, *c)) {
@@ -590,8 +590,6 @@ void inline_display(WINDOW *window, const char *c, const int colors) {
             // print regular char
             wprintw(window, "%c", *c);
         }
-
-        c++;
     }
 
     // pop stack until empty to prevent formated trailing spaces