From: FreeBirdLjj Date: Mon, 29 Sep 2014 06:02:59 +0000 (+0800) Subject: Use for loop to iterate. X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=00c2ad02613ee0797c4403d7016d028223002f7a;p=smdp.git Use for loop to iterate. --- diff --git a/src/viewer.c b/src/viewer.c index 5413183..40e4bd7 100644 --- a/src/viewer.c +++ b/src/viewer.c @@ -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