From: Gilles Darold Date: Mon, 10 Sep 2018 12:59:36 +0000 (+0200) Subject: Fix illegal division by zero in incrental mode. Thanks to aleszeleny for the report. X-Git-Tag: v10.1~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b8c26751607b5a03c56a00ef2fd9c1995ebf1c9;p=pgbadger Fix illegal division by zero in incrental mode. Thanks to aleszeleny for the report. --- diff --git a/pgbadger b/pgbadger index 3ab6d5c..16d3142 100755 --- a/pgbadger +++ b/pgbadger @@ -7725,8 +7725,8 @@ $drawn_graphs{checkpointdistance_graph} $warnings .= "00s"; } if (exists $dinf{distance} || $dinf{estimate}) { - $distance .= "" . &comma_numbers(sprintf( "%.2f", $dinf{distance}{sum}/$dinf{distance}{count})) . " kB" . - &comma_numbers(sprintf( "%.2f", $dinf{estimate}{sum}/$dinf{distance}{count})) . + $distance .= "" . &comma_numbers(sprintf( "%.2f", $dinf{distance}{sum}/($dinf{distance}{count}||1))) . " kB" . + &comma_numbers(sprintf( "%.2f", $dinf{estimate}{sum}/($dinf{distance}{count}||1))) . " kB"; } else { $distance .= "00";