Date: Fri, 19 Jul 2024 17:07:49 GMT From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 7cd0a4c85dbe - main - bsdinstall: Consistently use item count as the first argument to calloc Message-ID: <202407191707.46JH7nXJ028210@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7cd0a4c85dbe5e8cd000f6b293ef2d579d22edfb commit 7cd0a4c85dbe5e8cd000f6b293ef2d579d22edfb Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-07-19 17:07:00 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-07-19 17:07:00 +0000 bsdinstall: Consistently use item count as the first argument to calloc Reported by: GCC 14 -Wcalloc-transposed-args Reviewed by: rlibby, imp, emaste Differential Revision: https://reviews.freebsd.org/D46012 --- usr.sbin/bsdinstall/distfetch/distfetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsdinstall/distfetch/distfetch.c b/usr.sbin/bsdinstall/distfetch/distfetch.c index c431e187799d..ddb8a8361d6b 100644 --- a/usr.sbin/bsdinstall/distfetch/distfetch.c +++ b/usr.sbin/bsdinstall/distfetch/distfetch.c @@ -130,8 +130,8 @@ fetch_files(int nfiles, char **urls) struct bsddialog_conf mgconf; /* Make the transfer list for mixedgauge */ - minilabel = calloc(sizeof(char *), nfiles); - miniperc = calloc(sizeof(int), nfiles); + minilabel = calloc(nfiles, sizeof(char *)); + miniperc = calloc(nfiles, sizeof(int)); if (minilabel == NULL || miniperc == NULL) errx(EXIT_FAILURE, "Error: distfetch minibars out of memory!");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407191707.46JH7nXJ028210>