@@ -26,6 +26,8 @@ number of PTRACE_SINGLESTEP iterations to do before declaring
success, for each tracer tracee pair set up.
.br
Default is 10,000.
+.br
+NUM must be at least 1
.TP
.B \-\-json=FILENAME
Write final results into FILENAME, JSON formatted.
@@ -80,7 +80,7 @@ static void usage(int error)
"-h --help print this message\n"
" --json=FILENAME write final results into FILENAME, JSON formatted\n"
"-q --quiet suppress running output\n"
- "-i --iters=NUM number of iterations\n"
+ "-i --iters=NUM number of iterations, NUM must be at least 1\n"
);
exit(error);
}
@@ -331,6 +331,9 @@ int main(int argc, char **argv)
case 'i':
case OPT_NITERS:
nsteps = atoi(optarg);
+ if (nsteps < 1) {
+ usage(0);
+ }
break;
default:
usage(1);
There must be one or more iterations, prevent the user from entering a number less than one Signed-off-by: John Kacur <jkacur@redhat.com> --- src/ssdd/ssdd.8 | 2 ++ src/ssdd/ssdd.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-)