mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
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
This commit is contained in:
parent
9a8221568a
commit
99cde7edec
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user