summaryrefslogtreecommitdiffstats
path: root/ProcessList.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2014-01-16 18:51:16 -0200
committerHisham Muhammad <hisham@gobolinux.org>2014-01-16 18:51:16 -0200
commit76a715ee8c8c8ace5a341d81ca39dd1747886187 (patch)
tree827aed752113618de0b2ba09ed0bb3edc0a9968a /ProcessList.c
parentc1e0f6e17c16236d68ed26a5e413e9234293f4d9 (diff)
Fix order of calloc arguments.
(Patch by Dawid Gajownik)
Diffstat (limited to 'ProcessList.c')
-rw-r--r--ProcessList.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ProcessList.c b/ProcessList.c
index a0aed392..b470344c 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -197,7 +197,7 @@ static ssize_t xread(int fd, void *buf, size_t count) {
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
ProcessList* this;
- this = calloc(sizeof(ProcessList), 1);
+ this = calloc(1, sizeof(ProcessList));
this->processes = Vector_new(Class(Process), true, DEFAULT_SIZE);
this->processTable = Hashtable_new(140, false);
this->usersTable = usersTable;
@@ -227,14 +227,14 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
this->topologyOk = true;
}
#endif
- this->cpus = calloc(sizeof(CPUData), cpus);
+ this->cpus = calloc(cpus, sizeof(CPUData));
for (int i = 0; i < cpus; i++) {
this->cpus[i].totalTime = 1;
this->cpus[i].totalPeriod = 1;
}
- this->fields = calloc(sizeof(ProcessField), LAST_PROCESSFIELD+1);
+ this->fields = calloc(LAST_PROCESSFIELD+1, sizeof(ProcessField));
// TODO: turn 'fields' into a Vector,
// (and ProcessFields into proper objects).
this->flags = 0;

© 2014-2024 Faster IT GmbH | imprint | privacy policy