From nobody Wed Oct 12 14:12:17 2022 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 4MnZNL12Gvz4fRYY; Wed, 12 Oct 2022 14:12:18 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MnZNL0dpXz44BN; Wed, 12 Oct 2022 14:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665583938; 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=l3kue8SrdZACKOVWGyY9nnakZ56n2vvKDGb/6zP8L0g=; b=p02XtpDZAw98MHdBbY01rUJXK9vtar6E7orwL8A/So6CK55/XVwQGwaoD86R+jneH8dtku 6+keJi65VprUaHpLRGbx3Qu+AgwqnRoeHFaRmUNmipgqY9ioVk+YV4ok2h+pXnEe/mxwro rVIAFqtcflMJM5auZQzKcPWEAPc81eYPdl9f9zUEDsNxBMq+nzoG9H2FdEQgSd6WiHEYEU PkF1CDR7WDJO13u+Kmxo2HT/uOcXyKd9SgTcfXIIKskgSMzsToDGBDPq+HUho5Q2+7eUWX 0TCJ3sB1x8fmud96SYbbWPq1Cp72Uqt9NEZ8WZuBjVBJepjb3jNpFzbdmNysBA== 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 4MnZNK6rKkz1KxD; Wed, 12 Oct 2022 14:12:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29CECH0v018805; Wed, 12 Oct 2022 14:12:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29CECHBS018789; Wed, 12 Oct 2022 14:12:17 GMT (envelope-from git) Date: Wed, 12 Oct 2022 14:12:17 GMT Message-Id: <202210121412.29CECHBS018789@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: a312f3e74286 - main - sort: add wrapper around 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a312f3e74286c9bccd498198bfd236c49916d891 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665583938; 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=l3kue8SrdZACKOVWGyY9nnakZ56n2vvKDGb/6zP8L0g=; b=CMcUaWJnArZDhDytRr/Cd0U1KtdWvV9Ec5Zl19nef9UW5wyr9fGwIsp5+p0ITW4MuzLYrm OsPS1NXSYbUZo9fUX/lWpdOUgKfeaeBkaVipAqceoVrzaz7G/JrQzIC/w/j5rbEBMXcSpm FArijLzbSGehHhqhivJKDJ8U44h1E4EiH4KJs7ReexAF8hBZyogzlkl+SzvyZWb05xl/Xj jqruIh2T80rAVx1P6cUVmuLb3/C5QR2kuyYKzhn6IQXqN54IxWmylWCq6sykm6Yc1Fkx5j UtaDvhFOfTtRlpqYmm+XV5272bBCGDQKL4T+V1OUU0QidxusHyKW+pSs3jkAOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665583938; a=rsa-sha256; cv=none; b=NQVaA6VXLjzraX2hrlHH8S2QFflEhCpTG3UgcC5rMHCnUcqEh6R5x0ei8+HbIo3+srwnji OPtx+WhbXR0AXYzy7bXGNoP2R3w9DrNnIGF61KYKAY3xJE5XNpwoSzSIoDbvxzGhQ2BI4A NN/PUCSrv4pcp4SAN3IBI1Ny8qIkvS8Hib9gvA/MqyAjhkKgVydGkfxD03YDcpWyb78hrB iHwfYqT/8iFUXu3PkHDmI02fb5DBdVgIdK7705H02hzgaI/tb0kivB2V4LjCG9KgYBuP4x rKxCkf6PUXOKCmQ1slw897mXdAOxsPGfZgWJV6Dgwf7ySG5/nKm7L2phSv2OsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=a312f3e74286c9bccd498198bfd236c49916d891 commit a312f3e74286c9bccd498198bfd236c49916d891 Author: Baptiste Daroussin AuthorDate: 2022-10-12 13:52:38 +0000 Commit: Baptiste Daroussin CommitDate: 2022-10-12 14:12:04 +0000 sort: add wrapper around calloc --- usr.bin/sort/mem.c | 10 ++++++++++ usr.bin/sort/mem.h | 1 + 2 files changed, 11 insertions(+) diff --git a/usr.bin/sort/mem.c b/usr.bin/sort/mem.c index dea37bb3a110..18794666da51 100644 --- a/usr.bin/sort/mem.c +++ b/usr.bin/sort/mem.c @@ -36,6 +36,16 @@ __FBSDID("$FreeBSD$"); #include "mem.h" +void* +sort_calloc(size_t nb, size_t size) +{ + void *ptr; + + if ((ptr = calloc(nb, size)) == NULL) + err(2, NULL); + return (ptr); +} + /* * malloc() wrapper. */ diff --git a/usr.bin/sort/mem.h b/usr.bin/sort/mem.h index cb21d6d4a221..6a4edcd59161 100644 --- a/usr.bin/sort/mem.h +++ b/usr.bin/sort/mem.h @@ -39,6 +39,7 @@ /* * mem.c */ +void *sort_calloc(size_t, size_t); void *sort_malloc(size_t); void sort_free(const void *ptr); void *sort_realloc(void *, size_t);