Date: Sat, 30 Nov 2024 16:51:40 GMT From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 7380c8ea849f - stable/13 - md5: Consistently use item count as the first argument to calloc Message-ID: <202411301651.4AUGpeJx051314@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7380c8ea849f717833043e90a547aeaf50908416 commit 7380c8ea849f717833043e90a547aeaf50908416 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-07-19 17:04:27 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-11-29 19:27:26 +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 (cherry picked from commit e8e2ab3c55228d66388a0b33de8c5ac4b3d6dbe9) --- 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 d895e59a3d59..1d99b4339e0f 100644 --- a/sbin/md5/md5.c +++ b/sbin/md5/md5.c @@ -352,7 +352,7 @@ main(int argc, char *argv[]) * Replace argv by an array of filenames from the digest file */ argc = 0; - argv = (char**)calloc(sizeof(char *), numrecs + 1); + argv = calloc(numrecs + 1, sizeof(char *)); for (rec = head; rec != NULL; rec = rec->next) { argv[argc] = rec->filename; argc++;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202411301651.4AUGpeJx051314>