Skip to content

Commit

Permalink
arithmetic: -r validation (#501)
Browse files Browse the repository at this point in the history
* Validation code for number range option -r was looking at the wrong variable name
* The intent of the code is for only validated input to be assigned to $range
  • Loading branch information
mknos committed Mar 14, 2024
1 parent 01e47d2 commit baaa330
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/arithmetic
Expand Up @@ -33,7 +33,7 @@ if (defined $opt{'o'}) {
}
my $range = 10;
if (defined $opt{'r'}) {
usage() if ($range !~ m/\A[0-9]+\Z/);
usage() if ($opt{'r'} !~ m/\A[0-9]+\Z/);
$range = $opt{'r'};
}
# Special case the range of 0. Since the right operator can only be 0,
Expand Down

0 comments on commit baaa330

Please sign in to comment.