From 5cc13dad3527d37e3384712aeb787137fcb768b3 Mon Sep 17 00:00:00 2001 From: Ariadna Vigo Date: Sun, 9 Aug 2020 20:20:14 +0200 Subject: Fixed clang warning about uninitialized var --- cras.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cras.c b/cras.c index 562ae0b..162796a 100644 --- a/cras.c +++ b/cras.c @@ -253,9 +253,11 @@ mark_list_mode(const char *crasfile, const char *id, int value) die("Task number must be greater than zero."); } + task = NULL; if (tasknum <= task_lst_get_size(list)) task = task_lst_get_task(list, tasknum - 1); + /* If task is still NULL, then it means tasknum wasn't within range. */ if (task == NULL) { task_lst_cleanup(&list); die("Task #%d does not exist.", tasknum); -- cgit v1.2.3