summaryrefslogtreecommitdiffstats
path: root/freebsd/FreeBSDProcessList.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-03-21 21:12:30 +0100
committercgzones <cgzones@googlemail.com>2021-04-14 17:29:56 +0200
commit99cde7edec4abeba8b57d56a4399137b77779ca8 (patch)
tree51d7382183001f10bc28069f93e49c5d7f1a4f84 /freebsd/FreeBSDProcessList.c
parent9a8221568ada269d20c3e9d291ad5f9d07cac755 (diff)
FreeBSD: silence unsigned integer underflow
freebsd/FreeBSDProcessList.c:252:47: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned int' #0 0x397c32 in FreeBSDProcessList_scanCPU /root/workspace/htop/htop/freebsd/FreeBSDProcessList.c:252:47 #1 0x38fe76 in ProcessList_goThroughEntries /root/workspace/htop/htop/freebsd/FreeBSDProcessList.c:438:4 #2 0x35ef9a in ProcessList_scan /root/workspace/htop/htop/ProcessList.c:618:4 #3 0x31ee9e in main /root/workspace/htop/htop/htop.c:468:4 #4 0x26bbcf in _start /usr/src/lib/csu/amd64/crt1.c:76:7
Diffstat (limited to 'freebsd/FreeBSDProcessList.c')
-rw-r--r--freebsd/FreeBSDProcessList.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/freebsd/FreeBSDProcessList.c b/freebsd/FreeBSDProcessList.c
index c5e8fd11..84d0946d 100644
--- a/freebsd/FreeBSDProcessList.c
+++ b/freebsd/FreeBSDProcessList.c
@@ -249,7 +249,7 @@ static inline void FreeBSDProcessList_scanCPU(ProcessList* pl) {
cpuData->temperature = NAN;
cpuData->frequency = NAN;
- const int coreId = (cpus == 1) ? 0 : (i - 1);
+ const int coreId = (cpus == 1) ? 0 : ((int)i - 1);
if (coreId < 0)
continue;

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