From 798a38a7945bdd876960855fec267547c787fdc5 Mon Sep 17 00:00:00 2001 From: Drath Vader Date: Fri, 24 Oct 2025 12:20:50 +0200 Subject: [PATCH] i might be restarted --- src/cpu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu.cpp b/src/cpu.cpp index 8052fdf..69600eb 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -43,11 +43,11 @@ void update(cpuSensors* c) { } // lots of reads but still faster than reading /proc/cpuinfo - char buf[5]; + char buf[8]; c->avg_freq = 0; for (uint8_t i = 0; i < N_CPU; i++) { readFile2("/sys/devices/system/cpu/cpu" + std::to_string(i) + "/cpufreq/cpuinfo_avg_freq", buf, sizeof(buf)); - c->avg_freq += strtol(buf, NULL, 10); + c->avg_freq += strtol(buf, NULL, 10) / 1000; } c->avg_freq /= N_CPU; }