]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
magic/test: remove NULL as format string 4271/head
authorJason Ish <jason.ish@oisf.net>
Fri, 27 Sep 2019 22:28:54 +0000 (16:28 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 3 Oct 2019 17:24:33 +0000 (19:24 +0200)
Remove passing NULL as a format string parameter
in test. Convert to FAIL_IF_NULL.

src/util-magic.c

index 9e1179747c8225adbb1d8335442653fa15a9e65b..69a4f1056f8ec510f6581bc541e3aac1e4758cea 100644 (file)
@@ -344,10 +344,7 @@ static int MagicDetectTest03(void)
     FAIL_IF_NULL(result);
 
     char *str = strstr(result, "OpenDocument Text");
-    if (str == NULL) {
-        printf("result %s, not \"OpenDocument Text\": ", str);
-        FAIL;
-    }
+    FAIL_IF_NULL(str);
 
     magic_close(magic_ctx);
     PASS;
@@ -517,10 +514,7 @@ static int MagicDetectTest07(void)
     FAIL_IF_NULL(result);
 
     char *str = strstr(result, "OpenDocument Text");
-    if (str == NULL) {
-        printf("result %s, not \"OpenDocument Text\": ", str);
-        FAIL;
-    }
+    FAIL_IF_NULL(str);
 
     MagicDeinit();
     PASS;