mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-24 23:15:46 +00:00
use xCalloc for allocating cpuData
This commit is contained in:
parent
ba4c67942c
commit
64fb7181ee
@ -176,7 +176,7 @@ static void LinuxProcessList_updateCPUcount(ProcessList* super) {
|
||||
|
||||
// Initialize the cpuData array before anything else.
|
||||
if (!this->cpuData) {
|
||||
this->cpuData = xReallocArrayZero(this->cpuData, super->existingCPUs ? (super->existingCPUs + 1) : 0, 2, sizeof(CPUData));
|
||||
this->cpuData = xCalloc(2, sizeof(CPUData));
|
||||
this->cpuData[0].online = true; /* average is always "online" */
|
||||
this->cpuData[1].online = true;
|
||||
super->activeCPUs = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user