diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2024-03-20 19:31:32 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2024-03-20 20:40:14 +0100 |
commit | 299ca6ed2febc6e51fb164578bbab7aa5b8fd34c (patch) | |
tree | 3578438c547915ec80761ba8569e6f9cf9829aa1 | |
parent | 5d3444ce327fdd4c17a67ecaf8886e9b15781d20 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |