Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CPUUsage (FreeBSD): silence compiler warnings
  • Loading branch information
CarterLi committed Oct 15, 2023
commit 0cc38c20be110f1729b35e56261d30447039aba7
2 changes: 1 addition & 1 deletion src/detection/cpuusage/cpuusage_bsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const char* ffGetCpuUsageInfo(FFlist* cpuTimes)
if(sysctlbyname("kern.cp_times", NULL, &neededLength, NULL, 0) != 0)
return "sysctlbyname(kern.cp_times, NULL) failed";

uint32_t coreCount = neededLength / (CPUSTATES * (uint32_t) sizeof(uint64_t));
uint32_t coreCount = (uint32_t) (neededLength / (CPUSTATES * sizeof(uint64_t)));
assert(coreCount > 0);

FF_AUTO_FREE uint64_t (*cpTimes)[CPUSTATES] = malloc(neededLength);
Expand Down