From nobody Sat Nov 30 16:51:20 2024 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 4Y0wzs16Xwz5fJ0s; Sat, 30 Nov 2024 16:51:21 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y0wzr6gNjz4nhX; Sat, 30 Nov 2024 16:51:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732985480; 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=wZyfv0XWU34fv4aZTSPkHmt7wz/euXpbVJMnaUV1alY=; b=jvacdD4bRe2OwNRWx82gFkwFq8alKnAcuyW5cEjotv2O53F/QcFlhP7khqfZhOKKrESgpN yqx24aIJ96sg8QojMgLK46kFz3u8KWbU0KTswwUXWae8C9Yz03HZ1HRk5cRm751tX6qmfO 7zlC1lcn/x8gNEwa/q4Kx0NZuml8Pit4juxuTX5PzDDpYQ2eAmF9AD2BVuEruWpSReoy27 KuY2n5TY3vjG3tO8kYc5iDW8R/zFGFnMuo1eWrfXibR3dQFOdVSWLRrcahmGGrz73HRkid txXEeihPBWJzjAmrdIMNGETdOyIS2me5t8BPGhd55nx9YywT2/eUvh8CvpYTCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732985480; 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=wZyfv0XWU34fv4aZTSPkHmt7wz/euXpbVJMnaUV1alY=; b=ggw+7KShz4CO++1alOzQUdsSb5DA7hDToiFlTEh63p7AEv3Ttc6/u5xnC8XSoNXpnsLkev CMfuOpp7YK7jDsWudf+JLym7phb/2c7cjfcmGq97qPTgnD9UIToDXtQfIYSGN6eglepiDY LNab5vpxUV3ojZKGPxPO2WRc8I+5k7CyonLdweQAhJzyZ/dEUi+CfMH3sLOdZFL73306vb Gtp2ZQeBiXD/wfBfyzy8Qgzqg6mmE2ocLBa4Ybx1+kN3vnmZQFNYLLJqrCH06r4gebXBLi BMFUo4xXIODM4/fzzVvr19RfMXgyH7XjJVl2TBhVTEEf78hf3kzCBcZXr9Ck/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732985480; a=rsa-sha256; cv=none; b=wMw+73pOjL7v+mZv3WstNkw1wqp3/iTYlu2SHaJAt5q/t/tCcqEF6R2G0NamjuYn54IvBG M2XWwCow37MXJgm377L93yeOUfa8RjGKHZoqCTHlO7Hdh4HaCUuN+HuUfzS6c5E3gpYPBt 7429veXYLin3HcmO9NBhFaB62bV+OHcMu3xsryT69KqCxYsewFof79cMqvR+bIXXLZW1g7 2jqHBLQkQWg0u91f9q9DTLdUwzD4dmR9YgWMUPhwBNa1gUEbvpVH8ip8p64Jilc7HKIoaQ 5JqPDjXVKnQ8fZQLFB+Bk1/9EJ02PyEUM8G6mcsP6tEHvXEaoI5XPv6/WzguyA== 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 4Y0wzr6DsyzGQL; Sat, 30 Nov 2024 16:51:20 +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 4AUGpKKb045794; Sat, 30 Nov 2024 16:51:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AUGpKNW045779; Sat, 30 Nov 2024 16:51:20 GMT (envelope-from git) Date: Sat, 30 Nov 2024 16:51:20 GMT Message-Id: <202411301651.4AUGpKNW045779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 263483280cbc - stable/14 - ministat: 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 263483280cbc900442dac4e0fdbb78a56d536186 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=263483280cbc900442dac4e0fdbb78a56d536186 commit 263483280cbc900442dac4e0fdbb78a56d536186 Author: John Baldwin AuthorDate: 2024-07-19 17:05:12 +0000 Commit: John Baldwin CommitDate: 2024-11-30 13:55:58 +0000 ministat: Consistently use item count as the first argument to calloc Reported by: GCC 14 -Wcalloc-transposed-args Reviewed by: rlibby, emaste Differential Revision: https://reviews.freebsd.org/D46011 (cherry picked from commit a971c60456223b22c0b3c557d712b36660dbcff9) --- usr.bin/ministat/ministat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/ministat/ministat.c b/usr.bin/ministat/ministat.c index 32472a8acee7..23d4fc0271ec 100644 --- a/usr.bin/ministat/ministat.c +++ b/usr.bin/ministat/ministat.c @@ -153,7 +153,7 @@ NewSet(void) ds = calloc(1, sizeof *ds); assert(ds != NULL); ds->lpoints = 100000; - ds->points = calloc(sizeof *ds->points, ds->lpoints); + ds->points = calloc(ds->lpoints, sizeof(*ds->points)); assert(ds->points != NULL); ds->syy = NAN; return(ds); @@ -167,7 +167,7 @@ AddPoint(struct dataset *ds, double a) if (ds->n >= ds->lpoints) { dp = ds->points; ds->lpoints *= 4; - ds->points = calloc(sizeof *ds->points, ds->lpoints); + ds->points = calloc(ds->lpoints, sizeof(*ds->points)); assert(ds->points != NULL); memcpy(ds->points, dp, sizeof *dp * ds->n); free(dp); @@ -356,7 +356,7 @@ PlotSet(struct dataset *ds, int val) bar = 0; if (pl->bar == NULL) { - pl->bar = calloc(sizeof(char *), pl->num_datasets); + pl->bar = calloc(pl->num_datasets, sizeof(char *)); assert(pl->bar != NULL); }