From 9ec65ebd37967e2faa737ef7ed9a3d8e927d699b Mon Sep 17 00:00:00 2001 From: Ari Archer Date: Sat, 4 May 2024 01:37:10 +0300 Subject: [PATCH] use increment operator Signed-off-by: Ari Archer --- src/stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stats.c b/src/stats.c index 6cc92cc..4cd45b4 100644 --- a/src/stats.c +++ b/src/stats.c @@ -257,8 +257,8 @@ unsigned char CPU_init(CPU *cpu) { if (strncmp(line, "model name", 10) == 0) { strncpy(cpu->model, strchr(line, ':') + 2, 64); cpu->model[strcspn(cpu->model, "\n")] = 0; - } else if (strncmp(line, "processor", 9) == 0 && cpu->core_count < 255) - cpu->core_count += 1; + } else if (cpu->core_count < 255 && strncmp(line, "processor", 9) == 0) + ++cpu->core_count; fclose(fp_cpu);