Browse code

print yara loading summary only is yara rules are detected

Kevin Lin authored on 2015/02/13 05:05:35
Showing 1 changed files
... ...
@@ -3718,12 +3718,14 @@ int cl_load(const char *path, struct cl_engine *engine, unsigned int *signo, uns
3718 3718
 	    return CL_EOPEN;
3719 3719
     }
3720 3720
 #ifdef YARA_PROTO
3721
-    cli_yaramsg("$$$$$$$$$$$$ YARA $$$$$$$$$$$$\n");
3722
-    cli_yaramsg("\tTotal Rules: %u\n", yara_total);
3723
-    cli_yaramsg("\tRules Loaded: %u\n", yara_loaded);
3724
-    cli_yaramsg("\tComplex conditions: %u\n", yara_complex);
3725
-    cli_yaramsg("\tMalformed strings: %u\n", yara_malform);
3726
-    cli_yaramsg("$$$$$$$$$$$$ YARA $$$$$$$$$$$$\n");
3721
+    if (yara_total) {
3722
+        cli_yaramsg("$$$$$$$$$$$$ YARA $$$$$$$$$$$$\n");
3723
+        cli_yaramsg("\tTotal Rules: %u\n", yara_total);
3724
+        cli_yaramsg("\tRules Loaded: %u\n", yara_loaded);
3725
+        cli_yaramsg("\tComplex conditions: %u\n", yara_complex);
3726
+        cli_yaramsg("\tMalformed strings: %u\n", yara_malform);
3727
+        cli_yaramsg("$$$$$$$$$$$$ YARA $$$$$$$$$$$$\n");
3728
+    }
3727 3729
 #endif
3728 3730
     return ret;
3729 3731
 }