From nobody Fri Jan 03 15:49:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YPp0D6B2Dz5k7Kn; Fri, 03 Jan 2025 15:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YPp0D5BLtz4Wdk; Fri, 3 Jan 2025 15:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735919340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMScghQ38n99JSCAl3mrOsrFcKxlwLqy+vly4d7fzg0=; b=nXVKnDCryJ4x/NXxCHHY0EnVYO/uenlpYl3zcJAAI1/kCVw6E9jLgKavzVI9OpHv+X0ToX uR++zf0w7wHEPLz8VWvBo/C8s4/+zBZf08hjwX9yTzXnReUBJL8LzLYRG7ymBRaj2pZ4xl Dtdv9oHT98kwJp2FEcpMKG5ejoAX5TKKrFNym5UjxUWQRIeDe4NCMtoKwatLU59aToAtgl AxbaHjcSJtvPOsAEv6RKjwYoape7BA0OsWRKFIHyeV/Mx6JOGzC1nVTfuNxszN2VN6WTc9 yyIeXHJ9ohY5lSSbRO67F/XmUruh8ro5Bw06C8CJcyrr0iltlAzDggXf52eoXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735919340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMScghQ38n99JSCAl3mrOsrFcKxlwLqy+vly4d7fzg0=; b=QJ/PdLGeKLF7p6QIdPSgqPMFYhEI7t7eQ4yoOyrXP0KZYBqROUwsDN1tfT3Vo5uTCagzcR Yy56CFoCmiW9jdiq3BQpJdjGeWogCOB6BTeCH0EJXKo56hmaRzcBJ4eaMDA2e1PzZEhqGj sA9/qSCnp7gMZE4t1eEQ2Gy1ER6jIN8FyDQeQOaCTEa7Tv2dvozvzeKgWPfJqjG4VzFrL6 i+jINWTq/qAvZ2BkdjwATH29bK3GCuyDL5pMPdjuKxRAeR8bd0E2XTyFGDMXJm0Qm59Itj MStKu+3KHG5ZiYqUfdc2l+G/pogsH6O1hTnZ6joF2JS2CjIgewhyT857KV94Cw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735919340; a=rsa-sha256; cv=none; b=x+lWc9TUE7OTvQatB/ZzyAd7ne+r2/dRJ8p8wf19MaWIe9MXH+9J7A1tM3P7FlFUbfiHVy 7SbQAELMwvc0Mos+9OK0M3kgZztQSHmJ0rkXo1Zvevedj6kqKHP9H9WRZ2+kmB5R1n7ETd WY701TnQOfQ02das4to1I+Py7Ax+FJLKH6mvK3AlP0dUBr5GjtqOoJmkEiY1Aw/un29fAR FGt9BHkPNOsi89Q5GIvcVC6Ordl6CbXna5wcxMKO2OjX0y2BvZuQ/1oswAcR7Q6I+KiYtI 0Op6ooX2IsOVCcYnw+avNmlK9Hmder4l6Uo9mg/dGnpT1LlttXM9Z7OVRlXKjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YPp0D4SXRz1RXt; Fri, 03 Jan 2025 15:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 503Fn0Ij060597; Fri, 3 Jan 2025 15:49:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 503Fn00v060594; Fri, 3 Jan 2025 15:49:00 GMT (envelope-from git) Date: Fri, 3 Jan 2025 15:49:00 GMT Message-Id: <202501031549.503Fn00v060594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 22956bc9dc90 - main - pac: Consistently use item count as the first argument to calloc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22956bc9dc907296196a37525a6726f6ba2c06ed Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=22956bc9dc907296196a37525a6726f6ba2c06ed commit 22956bc9dc907296196a37525a6726f6ba2c06ed Author: John Baldwin AuthorDate: 2025-01-03 15:41:36 +0000 Commit: John Baldwin CommitDate: 2025-01-03 15:44:27 +0000 pac: Consistently use item count as the first argument to calloc Reported by: GCC 14 -Wcalloc-transposed-args --- usr.sbin/lpr/pac/pac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/lpr/pac/pac.c b/usr.sbin/lpr/pac/pac.c index 22ed8bf7e3bb..260743f5c33a 100644 --- a/usr.sbin/lpr/pac/pac.c +++ b/usr.sbin/lpr/pac/pac.c @@ -248,7 +248,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++]; @@ -326,7 +326,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;