diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-12-29 20:51:55 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-12-29 20:51:55 +0000 |
commit | fd6135414d4051c8ded6102c0d936164773c413a (patch) | |
tree | 3123904a112471df9ada49e611671be9756ddfbd /usr/local/www | |
parent | 7d0f4544d4835a43bb7d88bd6fa665f9cf102261 (diff) | |
download | pfsense-fd6135414d4051c8ded6102c0d936164773c413a.zip pfsense-fd6135414d4051c8ded6102c0d936164773c413a.tar.gz |
MFC 8804
Fix divide by zero JS error
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/status_queues.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr/local/www/status_queues.php b/usr/local/www/status_queues.php index dbac8f4..80a74f9 100755 --- a/usr/local/www/status_queues.php +++ b/usr/local/www/status_queues.php @@ -149,7 +149,12 @@ While(!Connection_Aborted()) { echo "<script language='javascript'>\n"; - $packet_s = round(400 * (1 - $packet_sampled / $total_packets_s), 0); + /* Since pps can be 0, let's not divide by zero */ + if ($total_packets_s == 0) { + $packet_s = round(400 * (1 - $packet_sampled / $total_packets_s), 0); + } else { + $packet_s = 0; + } echo "document.queue{$i}widthb.style.width='{$packet_s}px';\n"; echo "document.queue{$i}widtha.style.width='" . (400 - $packet_s) . "px';\n"; |