Skip to content

Commit

Permalink
Add param check for -c option
Browse files Browse the repository at this point in the history
  • Loading branch information
pdeng6 committed Aug 15, 2024
1 parent 614e33f commit 3c83717
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion UnixBench/Run
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ sub parseArgs {
# Generate the requested list of bench programs.
my $opt;
my $word;
my $copies;
while ($word = shift(@words)) {
if ($word !~ m/^-/) { # A test name.
if ($word eq "all") {
Expand All @@ -928,7 +929,9 @@ sub parseArgs {
if (!defined($params->{'copies'})) {
$params->{'copies'} = [ ];
}
push(@{$params->{'copies'}}, shift(@words));
$copies = shift(@words);
abortRun("-c copies should be positive integer") if ($copies !~ m/^\d+$/ || $copies <= 0);
push(@{$params->{'copies'}}, );
} else {
die("Run: unknown option $word\n");
}
Expand Down

0 comments on commit 3c83717

Please sign in to comment.