From 6e8bc13aa3befba15e3df17cb32ef54d447fbfec Mon Sep 17 00:00:00 2001
From: Morris Jobke <morris.jobke@gmail.com>
Date: Tue, 27 Aug 2013 10:58:17 +0200
Subject: [PATCH] fix weird logical behaviour

---
 lib/helper.php | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/helper.php b/lib/helper.php
index dd2476eda5..cfb29028ee 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -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;
-- 
GitLab