Skip to content

Commit 3c83717

Browse files
committed
Add param check for -c option
1 parent 614e33f commit 3c83717

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

UnixBench/Run

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ sub parseArgs {
906906
# Generate the requested list of bench programs.
907907
my $opt;
908908
my $word;
909+
my $copies;
909910
while ($word = shift(@words)) {
910911
if ($word !~ m/^-/) { # A test name.
911912
if ($word eq "all") {
@@ -928,7 +929,9 @@ sub parseArgs {
928929
if (!defined($params->{'copies'})) {
929930
$params->{'copies'} = [ ];
930931
}
931-
push(@{$params->{'copies'}}, shift(@words));
932+
$copies = shift(@words);
933+
abortRun("-c copies should be positive integer") if ($copies !~ m/^\d+$/ || $copies <= 0);
934+
push(@{$params->{'copies'}}, );
932935
} else {
933936
die("Run: unknown option $word\n");
934937
}

0 commit comments

Comments
 (0)