summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2012-02-21 16:11:32 -0800
committerStephen Hemminger <shemminger@vyatta.com>2012-02-21 16:11:32 -0800
commit2dd53861dd8005f7175f81cea971f7eaddbecc89 (patch)
tree4d63956f3dec9e2b0af715a37b5a7d5033349d49
parente06924934de6114b57b5e36296aa0f1068ac9427 (diff)
downloadvyatta-cfg-qos-2dd53861dd8005f7175f81cea971f7eaddbecc89.tar.gz
vyatta-cfg-qos-2dd53861dd8005f7175f81cea971f7eaddbecc89.zip
Fix validation of value 0
Confusion over if ($value) vs if (defined($value)) in argument processing lead to 0 always being allowed.
-rwxr-xr-xscripts/vyatta-qos-util.pl14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/vyatta-qos-util.pl b/scripts/vyatta-qos-util.pl
index 6dae105..1d4e754 100755
--- a/scripts/vyatta-qos-util.pl
+++ b/scripts/vyatta-qos-util.pl
@@ -56,10 +56,10 @@ GetOptions(
"time=s" => \$timeval,
) or usage();
-getPercent($percent) if $percent;
-getPercentOrRate($percentrate) if $percentrate;
-getRate($rate) if $rate;
-getBurstSize($burst) if $burst;
-getProtocol($protocol) if $protocol;
-getDsfield($dscp) if $dscp;
-getTime($timeval) if $timeval;
+getPercent($percent) if defined($percent);
+getPercentOrRate($percentrate) if defined($percentrate);
+getRate($rate) if defined($rate);
+getBurstSize($burst) if defined($burst);
+getProtocol($protocol) if defined($protocol);
+getDsfield($dscp) if defined($dscp);
+getTime($timeval) if defined($timeval);