From 6eb5be9e30b23035632b674f6b46c18313cde63b Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Sat, 9 Nov 2024 10:49:21 +0100 Subject: Fix argument order of calloc on several occasions --- plugins/runcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/runcmd.c') diff --git a/plugins/runcmd.c b/plugins/runcmd.c index 2e53dc0b..74843149 100644 --- a/plugins/runcmd.c +++ b/plugins/runcmd.c @@ -130,7 +130,7 @@ static int np_runcmd_open(const char *cmdstring, int *pfd, int *pfderr) { /* each arg must be whitespace-separated, so args can be a maximum * of (len / 2) + 1. We add 1 extra to the mix for NULL termination */ argc = (cmdlen >> 1) + 2; - argv = calloc(sizeof(char *), argc); + argv = calloc(argc, sizeof(char *)); if (argv == NULL) { printf("%s\n", _("Could not malloc argv array in popen()")); -- cgit v1.2.3-74-g34f1