shithub: fuzz

Download patch

ref: 752a1197a29d380c6ca482f540f00c54b65a7460
parent: 98861d691b7f84e6cdedc5b27bcf3ebee4f3313d
author: seh <seh@localhost>
date: Thu Nov 29 08:41:35 EST 2018

clean up commandline

--- a/main.c
+++ b/main.c
@@ -29,7 +29,6 @@
 {
 	int nrounds = -1, i;
 	List tofuzz = mklist() ; // List of syscall table ID's to fuzz
-	char* arg;
 	stdout = Bfdopen(1, OWRITE);
 	long fuzz_seed = truerand();
 
@@ -36,17 +35,11 @@
 	ARGBEGIN{
 		case 'n':
 			// Number of rounds to iterate fuzzing for
-			arg = ARGF();
-			if(arg == nil)
-				usage();
-			nrounds = atoi(arg);
+			nrounds = atoi(EARGF(usage()));
 			break;
 		case 's':
 			// Seed to fuzz from
-			arg = ARGF();
-			if(arg == nil)
-				usage();
-			fuzz_seed = atol(arg);
+			fuzz_seed = atol(EARGF(usage()));
 			break;
 		default:
 			usage();
@@ -56,7 +49,7 @@
 	initsctable();
 	
 	// If no system calls are specified, throw usage()
-	if(argc == 0)
+	if(argc < 1)
 		usage();
 
 	// If the call name '?' is specified as the first argument, print all call names