From e0d4f62e3df24141e01a68f95d348a1b37f5135a Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Tue, 25 Jan 2011 03:25:23 -0700 Subject: Prevent division by zero. --- config/spamd/spamd_gather_stats.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'config/spamd') diff --git a/config/spamd/spamd_gather_stats.php b/config/spamd/spamd_gather_stats.php index a95e2596..2fee6904 100644 --- a/config/spamd/spamd_gather_stats.php +++ b/config/spamd/spamd_gather_stats.php @@ -75,7 +75,10 @@ foreach($connect_times as $c) { echo "N:"; echo $open_connections; echo ":"; -echo round(($average_connect_time / $total_connections)); +if($total_connections == 0) + echo 0; +else + echo round(($average_connect_time / $total_connections)); exit; -- cgit v1.2.3