diff options
author | Ariadna Vigo <arivigodr@gmail.com> | 2020-06-30 21:43:18 +0200 |
---|---|---|
committer | Ariadna Vigo <arivigodr@gmail.com> | 2020-06-30 21:43:18 +0200 |
commit | 885b0b987282e9ebd5fd1784efa7f6a19b1c1ba5 (patch) | |
tree | fdfdc6cd042b3c7512ca657dbb9e469ee55f5d91 | |
parent | 27e1ed64d8bcdda1cd1c57e4eca48551b1ed6f05 (diff) |
print_task now ignores TASK_VOID tasks
-rw-r--r-- | cras.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -72,8 +72,9 @@ printf_color(const char *ansi_color, const char *fmt, ...) static void print_task(TaskLst tasks, int i, int color) { - /* if (tasks.status[i] == TASK_VOID) - continue; */ + /* Null tasks are never printed */ + if (tasks.status[i] == TASK_VOID) + return; printf("#%02d ", i + 1); if (tasks.status[i] == TASK_TODO) @@ -101,12 +102,8 @@ print_output(TaskLst tasks, int color) printf("Tasks due for: %s\n", ctime(&tasks.expiry)); - for(i = 0; i < TASK_LST_MAX_NUM; ++i) { - if (tasks.status[i] == TASK_VOID) - continue; - + for(i = 0; i < TASK_LST_MAX_NUM; ++i) print_task(tasks, i, color); - } if (i > 0) putchar('\n'); |