mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 09:02:25 +00:00
cppcheck had the right idea, but the wrong scope on this one.
This commit is contained in:
parent
fe296de42f
commit
684112474b
1 changed files with 2 additions and 2 deletions
4
test.c
4
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
|
||||
|
|
Loading…
Reference in a new issue