From 81d09860f7b815a662c5192e36fcf5e83b3729f6 Mon Sep 17 00:00:00 2001 From: rliang <48518695+rkmcode@users.noreply.github.com> Date: Thu, 25 Jan 2024 03:36:15 +0800 Subject: [PATCH] Fix basic_string::_M_create exception when 1000>hz>999.5, round(hz)=1000 btop_draw.cpp: 793: Symbols::h_line * (7 - cpuHz.size()) exception --- src/linux/btop_collect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index 0c1ab66..5e0af36 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -583,7 +583,7 @@ namespace Cpu { cpuhz += " GHz"; } else if (hz > 0) - cpuhz = to_string((int)round(hz)) + " MHz"; + cpuhz = to_string((int)hz) + " MHz"; } catch (const std::exception& e) {