diff options
| author | shevabam <shevabam@gmail.com> | 2017-11-02 20:54:43 +0100 |
|---|---|---|
| committer | shevabam <shevabam@gmail.com> | 2017-11-02 20:54:43 +0100 |
| commit | 725787bcf7421143d6567e5b4f39ab5fd3fd8695 (patch) | |
| tree | 350af5d92c101bd697b9bb0b165f172915a3742a /libs/swap.php | |
| parent | f6dc27183987b65dc06c11dbfd21507da15f1ea7 (diff) | |
fix PHP 7.1 notices "non well formed numeric value" #52
Diffstat (limited to 'libs/swap.php')
| -rw-r--r-- | libs/swap.php | 2 |
1 files changed, 2 insertions, 0 deletions
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; |
