From 725787bcf7421143d6567e5b4f39ab5fd3fd8695 Mon Sep 17 00:00:00 2001 From: shevabam Date: Thu, 2 Nov 2017 20:54:43 +0100 Subject: fix PHP 7.1 notices "non well formed numeric value" #52 --- libs/swap.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libs/swap.php') diff --git a/libs/swap.php b/libs/swap.php index e3cc980..42fbf8d 100644 --- a/libs/swap.php +++ b/libs/swap.php @@ -6,12 +6,14 @@ if (!($free = shell_exec('grep SwapFree /proc/meminfo | awk \'{print $2}\''))) { $free = 0; } +$free = (int)$free; // Total if (!($total = shell_exec('grep SwapTotal /proc/meminfo | awk \'{print $2}\''))) { $total = 0; } +$total = (int)$total; // Used $used = $total - $free; -- cgit v1.3