From 265c2ebd2fc0d1fc7be26a8452203e14378f8fdb Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Sat, 24 Nov 2018 12:55:51 +0100 Subject: [PATCH] parseInt radix added --- docs/index.html | 2 +- lib/cpu.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/index.html b/docs/index.html index eb0cf38..6b77f22 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,7 +9,7 @@ -

systeminformatiomn

+

systeminformation

Simple system and OS information library for node.js

diff --git a/lib/cpu.js b/lib/cpu.js index 6177fef..e01b98b 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -557,7 +557,7 @@ function cpuTemperature(callback) { let sum = 0; let lines = stdout.split('\r\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0); lines.forEach(function (line) { - let value = (parseInt(line) - 2732) / 10; + let value = (parseInt(line, 10) - 2732) / 10; sum = sum + value; if (value > result.max) result.max = value; result.cores.push(value); @@ -787,8 +787,8 @@ function cpuCache(callback) { result.l1i = 0; result.l2 = util.getValue(lines, 'l2cachesize', '='); result.l3 = util.getValue(lines, 'l3cachesize', '='); - if (result.l2) { result.l2 = parseInt(result.l2) * 1024; } - if (result.l3) { result.l3 = parseInt(result.l3) * 1024; } + if (result.l2) { result.l2 = parseInt(result.l2, 10) * 1024; } + if (result.l3) { result.l3 = parseInt(result.l3, 10) * 1024; } } exec(util.getWmic() + ' path Win32_CacheMemory get CacheType,InstalledSize,Purpose', function (error, stdout) { if (!error) {