From 0cb31e7b11641e9625ddcad0d41c6de627179c8c Mon Sep 17 00:00:00 2001 From: aristocratos Date: Wed, 5 Oct 2022 10:41:09 +0200 Subject: [PATCH] Fixed: Cpu::collect() core count counter... --- src/linux/btop_collect.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index b8b53f1..c86926f 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -680,7 +680,7 @@ namespace Cpu { for (; i <= Shared::coreCount; i++) { //? Make sure to add zero value for missing core values if at end of file - if ((not cread.good() or cread.peek() != 'c') and i < Shared::coreCount) { + if ((not cread.good() or cread.peek() != 'c') and i <= Shared::coreCount) { if (i == 0) throw std::runtime_error("Failed to parse /proc/stat"); else cpu.core_percent.at(i-1).push_back(0); } @@ -758,9 +758,9 @@ namespace Cpu { if (i < Shared::coreCount + 1) throw std::runtime_error("Failed to parse /proc/stat"); } catch (const std::exception& e) { - Logger::debug("get_cpuHz() : " + string{e.what()}); + Logger::debug("Cpu::collect() : " + string{e.what()}); if (cread.bad()) throw std::runtime_error("Failed to read /proc/stat"); - else throw std::runtime_error("collect() : " + string{e.what()}); + else throw std::runtime_error("Cpu::collect() : " + string{e.what()}); } if (Config::getB("show_cpu_freq"))