From nobody Fri Apr 05 18:31:26 2024 X-Original-To: dev-commits-src-main@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 4VB6Wf3JSbz5GxtP; Fri, 5 Apr 2024 18:31:26 +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 4VB6Wf2sx7z4hcS; Fri, 5 Apr 2024 18:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712341886; 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=IIXJWPH/4AFmBVfCPMDXQVnYowF24/3EEzeCM681/gA=; b=vQ3lpij/ydh6q46h3IRdfctT/YGeRIqgd2W4kXMeOQKxYDpqfPrlGI0pOMQteOahKu/2Uc 9+sCPk/obqOxcKQyhSmAFPfKdKj6aC9xlPQu0vs5uFOndA1Z+uZN9jEVEo7oSpmPzGinEj 5h6aZB8dPtpGFFNBfB4IwSaXucI2hCY+BOEzp8CzPAR/r6u2yF/1quk3kc4XQ5CI7n7A9Z O5NEBz+qumVM6bm3qAVSlBv1L6tnYRQ0gIILGWk9Sfmt3XAb3TM/3UOBFudBdRqITwipxR WZXF9Cmkqg3lDsaiSxfSuflx1De4ZaKeIXCC1Jnr1hReViEqK5QYj9cTLEsztQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712341886; a=rsa-sha256; cv=none; b=ePLtoXOQhsSpGYIkg9n4EwbHw8KeRbq/aAhvOz8LYQsCBOSpUKz7tzQTfOayJboztzJmTH AQ/CmXQIySMZCS2uXd/JDXZj8nGsA/yBN90b+BN0agiMOtZCdz9y8BSqFhmd9CDQ54EYQ3 JjmkE0umcgp5yXoZAgoGptaJQXCBuAFjtvP3uwwwdAsvFdDRP0epSO89iysPJx5TGYySH5 mzQ4xqa+PLoLy1NrMJCHXlERIMd5YuJYTEjIvcMH6fvaF0UMcI1Yvpy1ckj6VoHjyV3x1g kLQCLpf7QD8/Fxh7nnTe+SZLjhHic7DLCSgPCLxQLWENhU0q6h618HAB4d5XcA== 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=1712341886; 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=IIXJWPH/4AFmBVfCPMDXQVnYowF24/3EEzeCM681/gA=; b=wIrXtfLi8Gz7nVohr6PFN6xFNAgEZMWkAXud3NzBJ4J9ddOgu3eSIjovUtJ5nArhBAYFIS AfvEMJmSgjOtJLPFC6zCbvkslMwGzHWbLiLmLmkzSeHRtRAPDv2inktopimRUf8fFXbsoA 0RgSglgWIx+CQ9jjP7QEgdnYTGwlU8JdDMvemzD3B3c7MZEwm/RG/duJ/6VB5Vx0Vw2y24 pK+LNhY+cUiBAm4IHHmfwNotHVQot/dvxHl/mY5zg6Uqvo9hpX7c9UpPobmJ3+lw+Xj14S zn9JDnfoylDRe48nUemLbyzC/gCM0PKQlyFfiweIS2tX5eoXv4eImc8b5yp78w== 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 4VB6Wf2TfRz19jD; Fri, 5 Apr 2024 18:31:26 +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 435IVQ83017150; Fri, 5 Apr 2024 18:31:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 435IVQwR017147; Fri, 5 Apr 2024 18:31:26 GMT (envelope-from git) Date: Fri, 5 Apr 2024 18:31:26 GMT Message-Id: <202404051831.435IVQwR017147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 8268a31bcceb - main - which: Use size_t instead of ssize_t for pathlen List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 8268a31bcceb9ebe32d380cab792c89c5d897d15 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8268a31bcceb9ebe32d380cab792c89c5d897d15 commit 8268a31bcceb9ebe32d380cab792c89c5d897d15 Author: Collin Funk AuthorDate: 2024-02-11 04:26:38 +0000 Commit: Mark Johnston CommitDate: 2024-04-05 18:30:31 +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 --- 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;