aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2025-01-03 15:41:36 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2025-02-13 16:01:23 +0000
commit720d255477453f77b1200880db4b9e776327150e (patch)
tree0ebeb0935cb99e7b43c40af8b80863f76214a503
parentac2170b9955134c66f0e820b9dc1daa8f4d0e6a3 (diff)
pac: Consistently use item count as the first argument to calloc
Reported by: GCC 14 -Wcalloc-transposed-args (cherry picked from commit 22956bc9dc907296196a37525a6726f6ba2c06ed)
-rw-r--r--usr.sbin/lpr/pac/pac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/lpr/pac/pac.c b/usr.sbin/lpr/pac/pac.c
index 5eb5cab02353..d79b84c4ab9b 100644
--- a/usr.sbin/lpr/pac/pac.c
+++ b/usr.sbin/lpr/pac/pac.c
@@ -260,7 +260,7 @@ dumpit(void)
hp = hashtab[0];
hno = 1;
- base = (struct hent **) calloc(sizeof hp, hcount);
+ base = (struct hent **) calloc(hcount, sizeof(hp));
for (ap = base, c = hcount; c--; ap++) {
while (hp == NULL)
hp = hashtab[hno++];
@@ -338,7 +338,7 @@ enter(const char name[])
return(hp);
h = hash(name);
hcount++;
- hp = (struct hent *) calloc(sizeof *hp, (size_t)1);
+ hp = (struct hent *) calloc(1, sizeof(*hp));
hp->h_name = strdup(name);
hp->h_feetpages = 0.0;
hp->h_count = 0;