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~54^2~37 X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=181c7f05d47d4abea62618b3b6d24b2298585247;hp=e7df943cfbdba0f138c3946fb09d6d9a7f0fc4b7 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];