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 --- lib/utils_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/utils_cmd.c') diff --git a/lib/utils_cmd.c b/lib/utils_cmd.c index 416cf824..18350ac0 100644 --- a/lib/utils_cmd.c +++ b/lib/utils_cmd.c @@ -290,7 +290,7 @@ int cmd_run(const char *cmdstring, output *out, output *err, int flags) { /* 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((size_t)argc, sizeof(char *)); if (argv == NULL) { printf("%s\n", _("Could not malloc argv array in popen()")); -- cgit v1.2.3-74-g34f1