git: c28d88cda423 - stable/14 - bsdinstall: Consistently use item count as the first argument to calloc
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 30 Nov 2024 16:51:21 UTC
The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c28d88cda42386709d316625c102b4d00a8bb9c6 commit c28d88cda42386709d316625c102b4d00a8bb9c6 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-07-19 17:07:00 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-11-30 13:55:58 +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 (cherry picked from commit 7cd0a4c85dbe5e8cd000f6b293ef2d579d22edfb) --- 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 01f5f1aa214b..e18fa0225048 100644 --- a/usr.sbin/bsdinstall/distfetch/distfetch.c +++ b/usr.sbin/bsdinstall/distfetch/distfetch.c @@ -131,8 +131,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!");