diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-11-09 10:49:21 +0100 |
---|---|---|
committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-11-09 10:49:21 +0100 |
commit | 6eb5be9e30b23035632b674f6b46c18313cde63b (patch) | |
tree | ce9808a8c635f9add0f592540168d771f4ee5d0a /plugins/runcmd.c | |
parent | b370072a5a1e21876abf8cf95f4622c02565ae07 (diff) | |
download | monitoring-plugins-6eb5be9.tar.gz |
Fix argument order of calloc on several occasions
Diffstat (limited to 'plugins/runcmd.c')
-rw-r--r-- | plugins/runcmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) { | |||
130 | /* each arg must be whitespace-separated, so args can be a maximum | 130 | /* each arg must be whitespace-separated, so args can be a maximum |
131 | * of (len / 2) + 1. We add 1 extra to the mix for NULL termination */ | 131 | * of (len / 2) + 1. We add 1 extra to the mix for NULL termination */ |
132 | argc = (cmdlen >> 1) + 2; | 132 | argc = (cmdlen >> 1) + 2; |
133 | argv = calloc(sizeof(char *), argc); | 133 | argv = calloc(argc, sizeof(char *)); |
134 | 134 | ||
135 | if (argv == NULL) { | 135 | if (argv == NULL) { |
136 | printf("%s\n", _("Could not malloc argv array in popen()")); | 136 | printf("%s\n", _("Could not malloc argv array in popen()")); |