diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-11-09 09:49:21 (GMT) |
---|---|---|
committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-11-09 09:49:21 (GMT) |
commit | 6eb5be9e30b23035632b674f6b46c18313cde63b (patch) | |
tree | ce9808a8c635f9add0f592540168d771f4ee5d0a /lib/utils_cmd.c | |
parent | b370072a5a1e21876abf8cf95f4622c02565ae07 (diff) | |
download | monitoring-plugins-6eb5be9e30b23035632b674f6b46c18313cde63b.tar.gz |
Fix argument order of calloc on several occasionsrefs/pull/2045/head
Diffstat (limited to 'lib/utils_cmd.c')
-rw-r--r-- | lib/utils_cmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils_cmd.c b/lib/utils_cmd.c index 416cf82..18350ac 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) { | |||
290 | /* each arg must be whitespace-separated, so args can be a maximum | 290 | /* each arg must be whitespace-separated, so args can be a maximum |
291 | * of (len / 2) + 1. We add 1 extra to the mix for NULL termination */ | 291 | * of (len / 2) + 1. We add 1 extra to the mix for NULL termination */ |
292 | argc = (cmdlen >> 1) + 2; | 292 | argc = (cmdlen >> 1) + 2; |
293 | argv = calloc(sizeof(char *), argc); | 293 | argv = calloc((size_t)argc, sizeof(char *)); |
294 | 294 | ||
295 | if (argv == NULL) { | 295 | if (argv == NULL) { |
296 | printf("%s\n", _("Could not malloc argv array in popen()")); | 296 | printf("%s\n", _("Could not malloc argv array in popen()")); |