From baaa33032b3cabbfc76760e55e1091c3ba22e826 Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Thu, 14 Mar 2024 13:12:50 +0800 Subject: [PATCH] arithmetic: -r validation (#501) * 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 --- bin/arithmetic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/arithmetic b/bin/arithmetic index de099782..325b0594 100755 --- a/bin/arithmetic +++ b/bin/arithmetic @@ -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,