From cd55ead3e2810e209b726faca12fa749f6875d0f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sat, 16 Dec 2017 18:33:16 +0100 Subject: Fix A LOT of type problems, logic flaws, uninitialized variables etc. Most of them were found by phpstorm, so I put in some time and went through the list, fixing quite a bunch of them. --- modules-available/statistics/inc/parser.inc.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'modules-available/statistics/inc/parser.inc.php') diff --git a/modules-available/statistics/inc/parser.inc.php b/modules-available/statistics/inc/parser.inc.php index acf6ebd4..679055a7 100644 --- a/modules-available/statistics/inc/parser.inc.php +++ b/modules-available/statistics/inc/parser.inc.php @@ -99,8 +99,8 @@ class Parser { $hdds = array(); // Could have more than one disk - linear scan $lines = preg_split("/[\r\n]+/", $data); - $dev = false; $i = 0; + $mbrToMbFactor = $sectorToMbFactor = 0; foreach ($lines as $line) { if (preg_match('/^Disk (\S+):.* (\d+) bytes/i', $line, $out)) { // --- Beginning of MBR disk --- @@ -260,7 +260,6 @@ class Parser { public static function parseSmartctl(&$hdds, $data) { $lines = preg_split("/[\r\n]+/", $data); - $i = 0; foreach ($lines as $line) { if (preg_match('/^NEXTHDD=(.+)$/', $line, $out)) { unset($dev); -- cgit v1.2.3-55-g7522