diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-06-01 16:07:15 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-06-01 16:07:15 -0700 |
commit | d14face4635efff9ce7897bb7cdb23d640a5d5da (patch) | |
tree | c853a0b7552114017367c7ee5502091ef9e1e112 /lib/Vyatta/Qos | |
parent | 59bd1079cd35353631fc505aec6d0537e21203cf (diff) | |
parent | 8a9faf63f172a37fc12f43e504f94ce92d863a1a (diff) | |
download | vyatta-cfg-qos-d14face4635efff9ce7897bb7cdb23d640a5d5da.tar.gz vyatta-cfg-qos-d14face4635efff9ce7897bb7cdb23d640a5d5da.zip |
Merge branch 'jenner' into kenwood
Conflicts:
debian/changelog
Diffstat (limited to 'lib/Vyatta/Qos')
-rw-r--r-- | lib/Vyatta/Qos/Util.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Vyatta/Qos/Util.pm b/lib/Vyatta/Qos/Util.pm index 151b1d3..242e2b4 100644 --- a/lib/Vyatta/Qos/Util.pm +++ b/lib/Vyatta/Qos/Util.pm @@ -27,6 +27,9 @@ use base qw(Exporter); sub get_num { use POSIX qw(strtod); my ($str) = @_; + return unless $str; + + # remove leading/trailing spaces $str =~ s/^\s+//; $str =~ s/\s+$//; @@ -86,6 +89,8 @@ sub getAutoRate { sub getRate { my $rate = shift; + $rate or die "Rate not defined"; + my ( $num, $suffix ) = get_num($rate); defined $num |