mailarchive of the pengutronix oss-tools mailing list
 help / color / mirror / Atom feed
* [OSS-Tools] [PATCH platsch] fix calloc argument order
@ 2024-06-14 14:12 Philipp Zabel
  0 siblings, 0 replies; only message in thread
From: Philipp Zabel @ 2024-06-14 14:12 UTC (permalink / raw)
  To: oss-tools

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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-14 14:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-14 14:12 [OSS-Tools] [PATCH platsch] fix calloc argument order Philipp Zabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox