summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2024-03-20 19:31:32 +0100
committerBenBE <BenBE@geshi.org>2024-03-20 20:40:14 +0100
commit299ca6ed2febc6e51fb164578bbab7aa5b8fd34c (patch)
tree3578438c547915ec80761ba8569e6f9cf9829aa1
parent5d3444ce327fdd4c17a67ecaf8886e9b15781d20 (diff)
Avoid too large CPU field widths
In case the current CPU usage percentage is NAN the width calculation is invalid. Use the default with of 4, which is appropriate for "N/A ".
-rw-r--r--Process.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Process.c b/Process.c
index 9179c0ea..3e0d42bb 100644
--- a/Process.c
+++ b/Process.c
@@ -1071,7 +1071,7 @@ void Process_updateExe(Process* this, const char* exe) {
}
void Process_updateCPUFieldWidths(float percentage) {
- if (percentage < 99.9F) {
+ if (percentage < 99.9F || isNaN(percentage)) {
Row_updateFieldWidth(PERCENT_CPU, 4);
Row_updateFieldWidth(PERCENT_NORM_CPU, 4);
return;

© 2014-2024 Faster IT GmbH | imprint | privacy policy