From: Wolfram Schneider Date: Fri, 23 Apr 2010 15:42:08 +0000 (+0200) Subject: do not try to print more rows than available X-Git-Tag: CPAN-v1.02~92 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=301667245bbf232bec71c79a891f6c6fdcfb2c1f;p=irspy-moved-to-github.git do not try to print more rows than available --- diff --git a/web/htdocs/details/stats.mc b/web/htdocs/details/stats.mc index 97eb639..e50f56a 100644 --- a/web/htdocs/details/stats.mc +++ b/web/htdocs/details/stats.mc @@ -83,7 +83,7 @@ $col3 => undef my $hr; $hr = $stats->{$data}; my @sorted = sort { $hr->{$b} <=> $hr->{$a} || $a <=> $b } keys %$hr; -my $n = @sorted; $n = $maxrows if @sorted > 10; +my $n = @sorted; $n = $maxrows if @sorted > 10 && $n > $maxrows; foreach my $i (1..$n) { my $key = $sorted[$i-1];