mblaze, a Maildir-focused command line mail client
 help / color / mirror / code / Atom feed
* [PATCH] Fix calloc argument order
@ 2024-05-18  9:30 Silvan Jegen
  0 siblings, 0 replies; only message in thread
From: Silvan Jegen @ 2024-05-18  9:30 UTC (permalink / raw)
  To: mblaze; +Cc: Silvan Jegen

These were found through gcc warnings.
---
 mflag.c   | 2 +-
 msort.c   | 2 +-
 mthread.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mflag.c b/mflag.c
index ddf633c..9ee8747 100644
--- a/mflag.c
+++ b/mflag.c
@@ -145,7 +145,7 @@ main(int argc, char *argv[])
 			return 0;
 		}
 
-		args = calloc(sizeof (char *), argsalloc);
+		args = calloc(argsalloc, sizeof (char *));
 		if (!args)
 			exit(-1);
 
diff --git a/msort.c b/msort.c
index 5d2d88d..02d1e42 100644
--- a/msort.c
+++ b/msort.c
@@ -319,7 +319,7 @@ main(int argc, char *argv[])
 
 	xpledge("stdio rpath", "");
 
-	mails = calloc(sizeof (struct mail), mailalloc);
+	mails = calloc(mailalloc, sizeof (struct mail));
 	if (!mails)
 		exit(-1);
 
diff --git a/mthread.c b/mthread.c
index d200879..77fb21e 100644
--- a/mthread.c
+++ b/mthread.c
@@ -365,7 +365,7 @@ sort_tree(struct container *c, int depth)
 		if (i == 1)  // no sort needed
 			return;
 
-		struct container **a = calloc(sizeof (struct container *), i);
+		struct container **a = calloc(i, sizeof (struct container *));
 		if (!a)
 			return;
 
-- 
2.45.1

-- 
You received this message because you are subscribed to the Google Groups "mblaze" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mblaze+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mblaze/20240518093029.4799-1-s.jegen%40gmail.com.

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

only message in thread, other threads:[~2024-05-18  9:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-18  9:30 [PATCH] Fix calloc argument order Silvan Jegen

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mblaze/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).