]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - test.c
cppcheck had the right idea, but the wrong scope on this one.
[xonotic/gmqcc.git] / test.c
diff --git a/test.c b/test.c
index 6682983a30e997278cd1745b585480a128bc916d..5f7eac7c83e948b141d314f658d2005e66479486 100644 (file)
--- a/test.c
+++ b/test.c
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#include "gmqcc.h"
+#include <stdlib.h>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#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
@@ -1283,6 +1286,7 @@ int main(int argc, char **argv) {
     char         *defs     = NULL;
 
     con_init();
+    OPTS_OPTION_U16(OPTION_MEMDUMPCOLS) = 16;
 
     /*
      * Command line option parsing commences now We only need to support
@@ -1321,7 +1325,7 @@ int main(int argc, char **argv) {
     }
     con_change(redirout, redirerr);
     succeed = test_perform("tests", defs);
-    util_meminfo();
+    stat_info();
 
 
     return (succeed) ? EXIT_SUCCESS : EXIT_FAILURE;