summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrliang <48518695+rkmcode@users.noreply.github.com>2024-01-25 03:36:15 +0800
committerGitHub <noreply@github.com>2024-01-25 03:36:15 +0800
commit81d09860f7b815a662c5192e36fcf5e83b3729f6 (patch)
tree87cf97e90b3ea6194b7cd3d9c20f5686192f1bc7
parentb2df50396b0405b8ce2cfa3b10d4542cfd9d73cd (diff)
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
-rw-r--r--src/linux/btop_collect.cpp2
1 files changed, 1 insertions, 1 deletions
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) {