From 299ca6ed2febc6e51fb164578bbab7aa5b8fd34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 20 Mar 2024 19:31:32 +0100 Subject: 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 ". --- Process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3