From 684112474b4ff1eee2dde4aa3f84c8b6c52c612f Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Fri, 21 Jun 2013 23:29:50 +0000 Subject: [PATCH] cppcheck had the right idea, but the wrong scope on this one. --- test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.c b/test.c index 1ebb33a..5f7eac7 100644 --- a/test.c +++ b/test.c @@ -325,6 +325,8 @@ static bool task_template_generate(task_template_t *tmpl, char tag, const char * */ if (value && *value && (*value == ' ' || *value == '\t')) value++; + else if (!value) + exit(EXIT_FAILURE); /* * Value will contain a newline character at the end, we need to strip @@ -332,8 +334,6 @@ static bool task_template_generate(task_template_t *tmpl, char tag, const char * */ if (strchr(value, '\n')) *strrchr(value, '\n')='\0'; - else /* cppcheck: possible nullpointer dereference */ - exit(EXIT_FAILURE); /* * Now allocate and set the actual value for the specific tag. Which -- 2.39.2