changeset 1363:b2f295125ed6 fuzz

-v for debug_trace
author Matt Johnston <matt@ucc.asn.au>
date Sun, 21 May 2017 18:53:33 +0800
parents 74a22c562cdf
children 17104db7928c
files fuzz-harness.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/fuzz-harness.c	Sun May 21 18:53:09 2017 +0800
+++ b/fuzz-harness.c	Sun May 21 18:53:33 2017 +0800
@@ -8,11 +8,20 @@
     int i;
     buffer *input = buf_new(100000);
 
-#if DROPBEAR_TRACE
-    debug_trace = 1;
+    for (i = 1; i < argc; i++) {
+#if DEBUG_TRACE
+        if (strcmp(argv[i], "-v") == 0) {
+            debug_trace = 1;
+        }
 #endif
+    }
 
     for (i = 1; i < argc; i++) {
+        if (argv[i][0] == '-') {
+            // ignore arguments
+            continue;
+        }
+
         char* fn = argv[i];
         buf_setlen(input, 0);
         buf_readfile(input, fn);