git: e8e2ab3c5522 - main - md5: Consistently use item count as the first argument to calloc

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 19 Jul 2024 17:07:46 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=e8e2ab3c55228d66388a0b33de8c5ac4b3d6dbe9

commit e8e2ab3c55228d66388a0b33de8c5ac4b3d6dbe9
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-07-19 17:04:27 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-07-19 17:06:20 +0000

    md5: Consistently use item count as the first argument to calloc
    
    Reported by:    GCC 14 -Wcalloc-transposed-args
    Reviewed by:    rlibby
    Differential Revision:  https://reviews.freebsd.org/D46009
---
 sbin/md5/md5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c
index 70fc7cb7eef1..10ffae53c775 100644
--- a/sbin/md5/md5.c
+++ b/sbin/md5/md5.c
@@ -592,7 +592,7 @@ main(int argc, char *argv[])
 		while (argc--)
 			gnu_check(*argv++);
 		argc = 0;
-		argv = calloc(sizeof(char *), numrecs + 1);
+		argv = calloc(numrecs + 1, sizeof(char *));
 		for (rec = head; rec != NULL; rec = rec->next) {
 			argv[argc] = rec->filename;
 			argc++;