X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=test.c;h=5f7eac7c83e948b141d314f658d2005e66479486;hp=e6567f05c21cbd888eb3a5f7a42fd31a2a7515b3;hb=684112474b4ff1eee2dde4aa3f84c8b6c52c612f;hpb=06cccbb646f50cc339c7c3a0713f5bc6fe668d7a diff --git a/test.c b/test.c index e6567f0..5f7eac7 100644 --- a/test.c +++ b/test.c @@ -20,10 +20,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "gmqcc.h" +#include +#include #include #include +#include "gmqcc.h" + opts_cmd_t opts; static const char *task_bins[] = { @@ -322,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 @@ -329,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