cppcheck had the right idea, but the wrong scope on this one.

This commit is contained in:
Dale Weiler 2013-06-21 23:29:50 +00:00
parent fe296de42f
commit 684112474b

4
test.c
View file

@ -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