mirror of https://github.com/xzeldon/htop.git
Fix initialization of cpuData structure. Closes #159.
This commit is contained in:
parent
430c7c9a9b
commit
36b7832884
|
@ -63,7 +63,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
||||||
this->cpuCount = MAX(cpus - 1, 1);
|
this->cpuCount = MAX(cpus - 1, 1);
|
||||||
this->cpus = realloc(this->cpus, cpus * sizeof(CPUData));
|
this->cpus = calloc(cpus, sizeof(CPUData));
|
||||||
|
|
||||||
for (int i = 0; i < cpus; i++) {
|
for (int i = 0; i < cpus; i++) {
|
||||||
this->cpus[i].totalTime = 1;
|
this->cpus[i].totalTime = 1;
|
||||||
|
|
Loading…
Reference in New Issue