From nobody Mon Apr 15 14:05:30 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 4VJ88B3KW8z5GfXG; Mon, 15 Apr 2024 14:05:30 +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 4VJ88B1Nc2z4WG3; Mon, 15 Apr 2024 14:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713189930; 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=C8CNp6WK36rVcROQEBVgS3tn2TRM9bXxoku1dlC1RXo=; b=tOUR6ZaSlqBS3krOj+NFrR4wi6petxJ4jKII9tpTSrSGSbqJxgz9AeO9UWFZiHfo1QK3+C uolR2Y9VFTmodIEvC/7+MXhxa6CNmICITbB8CfwldHOs3QN7T+uNh4ufNNAkHf3mnJODsh cI16NrVCQAtd82odwWZWIbPyxi2idcKOJTgv1ACIUOhrmiCE8DtI+adOeGWNbcELdBhSep 1WKA4d/N2M/KdA4GOnCBXTOIIVUNHqtSa8Br7S325bV8wCoXPj7Q10LFmcWVin57TyvPSq OgQmSbgg3xM6TfrJ6EbSPyv6DHH/zoWUHbpiEPqCoT+YvQqfFD/uoeTQs4Qyrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713189930; a=rsa-sha256; cv=none; b=MKjXAH0R9nS6FXwW1SOdYJJW8vJrq7Xi/sYF7vQ+/Eh4GLw19x3//Ru3HWW6frvC0T+NkB PEhpETsgllKbbgbtN68DNasxVIVK4G5j73g1tMoOySdxaer3ZquNaQnzQ4fmXS320sJG65 5HljRPFT4QRFv6Zpe0DqV7wTByHY69Vy2QvBksugEM0fFeDuVKTniIJcURFFNT5LTX2QJY iybNUjtC8M+kUJubOqweywpnxKL24MdZ7lv/a9OEmyqrvDa/YLbQ1cWjjJAfZNORB5U3BE Nf427rgOFGnlAwczrwbbfmgp/oHmGHpUlcbjkbbvLjBiMPjd7huKh7DpHIYZIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713189930; 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=C8CNp6WK36rVcROQEBVgS3tn2TRM9bXxoku1dlC1RXo=; b=mZdSflDj8gaeGL0Zvmwl49bITFWTJLdSBdp1MPHqXTnuKieuzgUiaydA9jT7CMMxFu72Pu NUeHk1Dnm6KwUupLGVNoLaY59Ca0caB4UIPKFzzmMpnqi4fZw0F9lfbEAbFnA/PmOHVauX KVkCxmsvuPSdXN8u7d5rWOba9fMKIQApFeZfOfbIxDzzsOrg/Mgc5G84KQPDL5Umcpga+M 6LIZIpfc6/MEuiVMSVoKkllgBzyNUI7f8vwKu4D55Fz5mVjAhSj8uvwvkZXy9UUahDzAJ8 dGHwPm6W8BDjJP3iWCOdcm27mzGl82vFkycx11vdcM0rwoIZNE59NmXcsGJNig== 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 4VJ88B0vv7z12kp; Mon, 15 Apr 2024 14:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43FE5UPY069944; Mon, 15 Apr 2024 14:05:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43FE5UVF069941; Mon, 15 Apr 2024 14:05:30 GMT (envelope-from git) Date: Mon, 15 Apr 2024 14:05:30 GMT Message-Id: <202404151405.43FE5UVF069941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 342a51f11018 - stable/14 - which: Use size_t instead of ssize_t for pathlen 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 342a51f11018a386643402c5b79a6f1768defb29 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=342a51f11018a386643402c5b79a6f1768defb29 commit 342a51f11018a386643402c5b79a6f1768defb29 Author: Collin Funk AuthorDate: 2024-02-11 04:26:38 +0000 Commit: Mark Johnston CommitDate: 2024-04-15 14:05:13 +0000 which: Use size_t instead of ssize_t for pathlen The "pathlen" variable is the return value of strlen(3) and is then passed as an argument to malloc(3) and memcpy(3). The size_t type matches the prototype for these functions. The size_t type is unsigned so it can fit larger $PATH values than ssize_t. However, in practice ssize_t should be larger enough so this change is just for clarity. Signed-off-by: Collin Funk MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1113 (cherry picked from commit 8268a31bcceb9ebe32d380cab792c89c5d897d15) --- usr.bin/which/which.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/which/which.c b/usr.bin/which/which.c index f6ee25f60cce..dc22efb815d8 100644 --- a/usr.bin/which/which.c +++ b/usr.bin/which/which.c @@ -45,7 +45,7 @@ int main(int argc, char **argv) { char *p, *path; - ssize_t pathlen; + size_t pathlen; int opt, status; status = EXIT_SUCCESS;