From nobody Tue Jul 22 15:11:47 2025 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 4bmgj026khz5pWlm; Tue, 22 Jul 2025 15:11:48 +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 4bmghz5kgzz3ptv; Tue, 22 Jul 2025 15:11:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753197107; 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=+obgaF1ByzpVqY3HxoLE4NJ2H3g1cdSxc0XRkINVc3I=; b=pGZ4KCiqukvQDyPXFNmyQSc1JbWB/4sjTKr7AfeqSQvl5bjL6OoiWZtp3oq+hs/MPp6uzK 7hVaY5EtiVkROvccQH0DUhqT1/5oo9258nzsUhGLViYYL5LyD9yZR6hDjz0bXMG10pNAzW pEWXxqAfvotXSA0SmJBGSAwrIIofdb2EovIIj+YLOG+5i+8rYZ5eJ6gjnZ7yITYKvkY2sO FGnGIDsk05DVVJNDV03296bN1bQW1G/ifX19vx0/rSwsC46x6Wp8TlLtwMSz/j74TODK1s NX5JNfHnJ/ObMulIJ1G3RuZNsdcjTXiw86VF8QiUYY2KGqjigvFIIS2zSlRL2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753197107; 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=+obgaF1ByzpVqY3HxoLE4NJ2H3g1cdSxc0XRkINVc3I=; b=dNUa7kqWrWcsfCFz2QJlBhEDXeGx89KcHAtcziZ5ek+y4v5jD/b577JexCEBIF/aieBKvy nsD7+YZ7icujXAlshWxHSXO7gSri8uZUPkwZtV6QGeSpaG0h2Uf3Om4/+vWvEpny8riOmL YyUyeuVjjV/XUDVlrOz6xQWbETrszcwJ333gWFqmQKqk55rOwL+F3nQJ9g/QY8a9CXwLtc g0VwFoLPnZkH0fqKpvIUZCoPSxkPK5WayRvKGTgreVFKbstaquy523KVAhGb57XJhZ85Lp LmtKOl3Wn7hb7kk7PKZIEZBx9NW5zmJR9aOLcJyDt37wq1mqE5/aEEYKRwp9VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753197107; a=rsa-sha256; cv=none; b=p1Rhkj5U3A4MqVqYqSEYNZ59qXLSp6fCUfVpj8mylTdMr92W8+27+oYtKlsrfcK8IOFJLz kCqIH9RahVQRmDcno0hPTEdWGCMzjMLG/ktXWFakgbWSA4dHZPLcAr5ywVYdJ0/sFL0D6S ZX3ft2USaUvTYJVvfOIeDbdeQfa4E5kccSVRqsrqe+nnc9nPxBO/KhZD71ABbuBflFux3J 6YQwhQOsXwCLc86yslcxzr5pDBCYb7U+9O24LTR4Q7AubpC6ozk5KMw0mBSZMdH0k03CNh W0tlXFfdY2rckUkT6UavcBrdkSCt/0ZJdvnhMXoQbyOxRDADr6rJu75HjAQJFg== 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 4bmghz5JyCzYpk; Tue, 22 Jul 2025 15:11:47 +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 56MFBlTT096307; Tue, 22 Jul 2025 15:11:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56MFBlfh096304; Tue, 22 Jul 2025 15:11:47 GMT (envelope-from git) Date: Tue, 22 Jul 2025 15:11:47 GMT Message-Id: <202507221511.56MFBlfh096304@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 441995e161a2 - main - memchr.3: mention the len argument in the functions description 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 441995e161a2564d37947d054a2f1219754deb5f Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=441995e161a2564d37947d054a2f1219754deb5f commit 441995e161a2564d37947d054a2f1219754deb5f Author: Konstantin Belousov AuthorDate: 2025-07-19 12:15:44 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-22 15:11:40 +0000 memchr.3: mention the len argument in the functions description Otherwise, its use is only specified in the error case, which is somewhat obscure. Also properly typeset NULL. Reviewed by: pauamma_gundo.com Discussed with: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D51424 --- lib/libc/string/memchr.3 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/libc/string/memchr.3 b/lib/libc/string/memchr.3 index f5d1fe5d5c7f..65617a117371 100644 --- a/lib/libc/string/memchr.3 +++ b/lib/libc/string/memchr.3 @@ -52,7 +52,10 @@ locates the first occurrence of (converted to an .Vt "unsigned char" ) in string -.Fa b . +.Fa b , +limited to at most +.Fa len +characters. .Pp The .Fn memrchr @@ -61,15 +64,18 @@ function behaves like except that it locates the last occurrence of .Fa c in string -.Fa b . +.Fa b , +limited to the first +.Fa len +characters. .Sh RETURN VALUES The .Fn memchr and .Fn memrchr -functions -return a pointer to the byte located, -or NULL if no such byte exists within +functions return a pointer to the byte located, or +.Dv NULL +if no such byte exists within .Fa len bytes. .Sh SEE ALSO