diff options
author | ache <ache@ache.one> | 2019-09-13 00:37:33 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2019-09-13 00:37:33 +0200 |
commit | 8b0aa8e2b552f57aaf8c6c9dfa164219aa85932d (patch) | |
tree | 8f94a84a42a2afd8ecdad76b773a759cad809f95 /main.c | |
parent | Search in conv feature (diff) |
Fix color message bug
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -24,11 +24,13 @@ #include <assert.h> #endif -const int color[] = { +const int colors[] = { COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE}; + + #define MAX_PATH 1024 #define EVENT_SIZE ( sizeof (struct inotify_event) ) #define EVENT_BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) ) @@ -181,8 +183,9 @@ int main(int argc, char* argv[]){ CHECK(wrefresh, sep_win); init_readline(); - for(int i = 0 ; i < 9 ; i++) { - init_pair( i+1, i, COLOR_BLACK); + const int nbColor = sizeof colors / sizeof *colors; + for(int i = 2 ; i < nbColor ; i++) { + init_pair( i, colors[i], COLOR_BLACK); } // inotify stuff |