Fix division by zero for broken storage, found by Corentin Chary

git-svn-id: http://www.observium.org/svn/observer/trunk@1792 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-04 17:54:12 +00:00
parent cbc9a7e20c
commit 3cbc71f7bd

View File

@@ -39,7 +39,14 @@ while($storage = mysql_fetch_array($storage_data)) {
if($debug) {print_r($storage);}
$percent = round($storage['used'] / $storage['size'] * 100);
if ($storage['size'])
{
$percent = round($storage['used'] / $storage['size'] * 100);
}
else
{
$percent = 0;
}
echo($percent."% ");