From: Philipp Zabel <p.zabel@pengutronix.de>
To: oss-tools@pengutronix.de
Subject: [OSS-Tools] [PATCH platsch] fix calloc argument order
Date: Fri, 14 Jun 2024 16:12:06 +0200 [thread overview]
Message-ID: <20240614141206.2766116-1-p.zabel@pengutronix.de> (raw)
It's number of elements first, size of each element second.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
platsch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/platsch.c b/platsch.c
index 535b589a659a..ea1d37317d0d 100644
--- a/platsch.c
+++ b/platsch.c
@@ -677,7 +677,7 @@ execinit:
goto sleep;
}
- initsargv = calloc(sizeof(argv[0]), argc + 1);
+ initsargv = calloc(argc + 1, sizeof(argv[0]));
if (!initsargv) {
error("failed to allocate argv for init\n");
return EXIT_FAILURE;
--
2.39.2
reply other threads:[~2024-06-14 14:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240614141206.2766116-1-p.zabel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=oss-tools@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox