git: 0c75f14512af - stable/13 - ctld: Consistently use item count as the first argument to calloc

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Sat, 30 Nov 2024 16:51:44 UTC
The branch stable/13 has been updated by jhb:

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

commit 0c75f14512afe6abaf9c5fea5a9c4bc29923d42c
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-07-19 17:07:22 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-11-29 19:28:59 +0000

    ctld: 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/D46013
    
    (cherry picked from commit 2ba12978f67432a3f88b17704391d28e1fc0e788)
---
 usr.sbin/ctld/isns.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/ctld/isns.c b/usr.sbin/ctld/isns.c
index 3c85c1a3cade..12aacbdef2b2 100644
--- a/usr.sbin/ctld/isns.c
+++ b/usr.sbin/ctld/isns.c
@@ -49,14 +49,14 @@ isns_req_alloc(void)
 {
 	struct isns_req *req;
 
-	req = calloc(sizeof(struct isns_req), 1);
+	req = calloc(1, sizeof(struct isns_req));
 	if (req == NULL) {
 		log_err(1, "calloc");
 		return (NULL);
 	}
 	req->ir_buflen = sizeof(struct isns_hdr);
 	req->ir_usedlen = 0;
-	req->ir_buf = calloc(req->ir_buflen, 1);
+	req->ir_buf = calloc(1, req->ir_buflen);
 	if (req->ir_buf == NULL) {
 		free(req);
 		log_err(1, "calloc");