From 76a715ee8c8c8ace5a341d81ca39dd1747886187 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 16 Jan 2014 18:51:16 -0200 Subject: Fix order of calloc arguments. (Patch by Dawid Gajownik) --- OpenFilesScreen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenFilesScreen.c') 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 { -- cgit v1.2.3