fixed to show correctly the graphs where there are less ports defined than the value of 'port->max'

This commit is contained in:
Jordi Sanfeliu 2013-04-24 15:34:09 +02:00
parent b372c8e66f
commit 14b8def4e6
1 changed files with 2 additions and 1 deletions

View File

@ -381,7 +381,7 @@ sub port_cgi {
$u = "";
}
my $max = max($port->{max}, scalar(my @pl = split(',', $port->{list})));
my $max = min($port->{max}, scalar(my @pl = split(',', $port->{list})));
for($n = 0; $n < $max; $n++) {
$pl[$n] = trim($pl[$n]);
my $pc = trim((split(',', $port->{desc}->{$pl[$n]}))[2]);
@ -400,6 +400,7 @@ sub port_cgi {
$n = $n3 = 0;
$n2 = 1;
while($n < $max) {
next unless $pl[$n];
if($title) {
if($n == 0) {
main::graph_header($title, $port->{graphs_per_row});