summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-12-29 20:51:55 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-12-29 20:51:55 +0000
commitfd6135414d4051c8ded6102c0d936164773c413a (patch)
tree3123904a112471df9ada49e611671be9756ddfbd /usr/local/www
parent7d0f4544d4835a43bb7d88bd6fa665f9cf102261 (diff)
downloadpfsense-fd6135414d4051c8ded6102c0d936164773c413a.zip
pfsense-fd6135414d4051c8ded6102c0d936164773c413a.tar.gz
MFC 8804
Fix divide by zero JS error
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/status_queues.php7
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";
OpenPOWER on IntegriCloud