test-self-compare-linux.cc: Fix some compilation warnings main
authorDodji Seketeli <dodji@seketeli.org>
Wed, 27 Aug 2025 15:54:33 +0000 (17:54 +0200)
committerDodji Seketeli <dodji@seketeli.org>
Wed, 27 Aug 2025 16:05:50 +0000 (18:05 +0200)
* test-self-compare-linux.cc (main): Use strcmp instead of using
the != operator between two char*.

Signed-off-by: Dodji Seketeli <dodji@seketeli.org>
test-self-compare-linux.cc

index 26def016298862b51e3f75fa0c970baaa1ffe12c..15fc32fa4d7688ca83a21efdc0eaf329a7a548e9 100644 (file)
@@ -129,7 +129,7 @@ main()
   for (InOutSpec *spec = in_out_specs; spec->in_kernel_tree_path; ++spec)
     {
       bool is_ok = true;
-      if (spec->in_kernel_tree_path != "")
+      if (strcmp(spec->in_kernel_tree_path, ""))
        in_kernel_tree_path = tests_src_dir + spec->in_kernel_tree_path;
       else
        in_kernel_tree_path = "";
@@ -140,7 +140,8 @@ main()
 
       in_vmlinux_path = tests_src_dir + spec->in_vmlinux_path;
 
-      if (spec->in_kmi_stablelist_path && spec->in_kmi_stablelist_path != "")
+      if (spec->in_kmi_stablelist_path
+         && strcmp(spec->in_kmi_stablelist_path, ""))
        in_kmi_stablelist_path = tests_src_dir + spec->in_kmi_stablelist_path;
       else
        in_kmi_stablelist_path = "";
@@ -166,7 +167,7 @@ main()
       std::ostringstream o;
       o << abidw << " --abidiff ";
 
-      if (spec->options && spec->options != "")
+      if (spec->options && strcmp(spec->options, ""))
        o << spec->options;
 
       if (in_kmi_stablelist_path != "")
This page took 0.056036 seconds and 5 git commands to generate.