diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2014-01-16 18:51:16 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-01-16 18:51:16 -0200 |
commit | 76a715ee8c8c8ace5a341d81ca39dd1747886187 (patch) | |
tree | 827aed752113618de0b2ba09ed0bb3edc0a9968a /OpenFilesScreen.c | |
parent | c1e0f6e17c16236d68ed26a5e413e9234293f4d9 (diff) |
Fix order of calloc arguments.
(Patch by Dawid Gajownik)
Diffstat (limited to 'OpenFilesScreen.c')
-rw-r--r-- | OpenFilesScreen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c index e33f2e76..ae511c83 100644 --- a/OpenFilesScreen.c +++ b/OpenFilesScreen.c @@ -83,7 +83,7 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { char command[1025]; snprintf(command, 1024, "lsof -P -p %d -F 2> /dev/null", pid); FILE* fd = popen(command, "r"); - OpenFiles_ProcessData* pdata = calloc(sizeof(OpenFiles_ProcessData), 1); + OpenFiles_ProcessData* pdata = calloc(1, sizeof(OpenFiles_ProcessData)); OpenFiles_FileData* fdata = NULL; OpenFiles_ProcessData* item = pdata; bool anyRead = false; @@ -104,7 +104,7 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { char* newline = strrchr(entry, '\n'); *newline = '\0'; if (cmd == 'f') { - OpenFiles_FileData* nextFile = calloc(sizeof(OpenFiles_ProcessData), 1); + OpenFiles_FileData* nextFile = calloc(1, sizeof(OpenFiles_ProcessData)); if (fdata == NULL) { pdata->files = nextFile; } else { |