fix weird logical behaviour

This commit is contained in:
Morris Jobke 2013-08-27 10:58:17 +02:00
parent c09cfe4fb9
commit 6e8bc13aa3

View file

@ -858,10 +858,8 @@ class OC_Helper {
} else {
$total = $free; //either unknown or unlimited
}
if ($total == 0) {
$total = 1; // prevent division by zero
}
if ($total >= 0) {
if ($total > 0) {
// prevent division by zero or error codes (negative values)
$relative = round(($used / $total) * 10000) / 100;
} else {
$relative = 0;