From 99cde7edec4abeba8b57d56a4399137b77779ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sun, 21 Mar 2021 21:12:30 +0100 Subject: 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 --- freebsd/FreeBSDProcessList.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'freebsd/FreeBSDProcessList.c') 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; -- cgit v1.2.3