From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 14 Jun 2024 16:12:10 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sI7f0-005xwd-2O for lore@lore.pengutronix.de; Fri, 14 Jun 2024 16:12:10 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1sI7ez-0004Wa-JO; Fri, 14 Jun 2024 16:12:09 +0200 Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1sI7ew-0004WJ-PZ; Fri, 14 Jun 2024 16:12:06 +0200 From: Philipp Zabel To: oss-tools@pengutronix.de Date: Fri, 14 Jun 2024 16:12:06 +0200 Message-Id: <20240614141206.2766116-1-p.zabel@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [OSS-Tools] [PATCH platsch] fix calloc argument order X-BeenThere: oss-tools@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: Pengutronix Public Open-Source-Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "OSS-Tools" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: oss-tools-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false It's number of elements first, size of each element second. Signed-off-by: Philipp Zabel --- 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