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
This commit is contained in:
rliang 2024-01-25 03:36:15 +08:00 committed by GitHub
parent b2df50396b
commit 81d09860f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {