From nobody Fri Nov 20 12:04:50 2026 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 4jWDXz50hvz71X1r for ; Fri, 20 Nov 2026 12:04:51 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jWDXy72mTz3Qbw for ; Fri, 20 Nov 2026 12:04:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795176291; 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=Pa9cYnUCLnQeznMUmrrTUVYegQn19FVPQNwGBQk7Onw=; b=boi0w43bObXNBS/+Doe8WqyBaFF4hpn0mTHeeutHKwuxCuvP2t6W+Yp+QjM6HE5Oan6Jyj 89le26feP74+wqzhbh/K4ISL0W2O31IBza81xsnjpbwoGOn67fS0Em3J3HsUWx8IEkgvwI FIRTYCYqkJiUE4/7H9kg4DkP3l4+nFrKSrUQqapPl43MdQFJBkCIPe2z4JZn7fHlyyfCMB X8ND1u9p0TGy25EsBEbXmGkImX7UXcBR+MVH1NJCpkBkymY6XDu10ZYZ3XWAKThwh2FT+O joRCjrZbPN1JWa5193bOKWfGXQbGDE0CXXhSN5kHcT/5mDXkre8uFaX3RaehjA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795176291; b=mZC8ZKeo4CuwmioBZZ9g+yUzYPjIRT7svvSuhgYKE26UGIJvpOd+wvkFlL5K9Mhc6UuO8q NZnbuTXjjuXolUMYgl+gu0SLneUIFcFhvbWHiOywfnqJv+d8h47AA5vaMCLpQYIZAR2Yj5 p31QlQCQnGb2oKMfAxj+GUARheQo8R+nyJDyBrSGifhaDlONUOsbxcxCyb/OFKXt2GAiy5 tWzIu/33BnGdnISU2GJ8qCDo20Lw+ZO24W/2f6HfQVTuzjjkgSophQxhg4kutgs6ZyLPCq BiyujjqZp9kB0HQGqPHUWZL29nx6emZmBvlmxpNE75BNq/jfBZ9b7gE0YKYnGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795176291; 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=Pa9cYnUCLnQeznMUmrrTUVYegQn19FVPQNwGBQk7Onw=; b=dA+4V2xcf442jHNYpJLp0UsrygsewCbTvzl6T3q2fAhOXz53qWsbcLuVxj2Sb9qi1gsrB9 u7vh5uM63LC8aVNHPoGR6mf0u6x78eG1s8SdrbxLmTZ2RcHrfMlKnabsN9B3wTBZLHsvHL t9K/79GE0rMp0YjuxDRk2UkHpjbixiwatGtQo4POKUnzNYx6/fH1dYq5veC6e7FIT6UfBc iJY4wrdcRG18ZDxnHpZt0bKS8mhyw9rR2xboO84P7/eI+V8gTnCui3hCkIBHNhlHKUGeuI eLsfgAgz3Uvw/rbxEqyftwbt7xo2gfjxgRvwnrciHJcEFQ/eZN4eGdvhXvCaWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jWDXy6YpnznLN for ; Fri, 20 Nov 2026 12:04:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 52af by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 20 Nov 2026 12:04:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: d298fd55afc2 - stable/14 - stdio: Fix positional %B / %b conversion List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d298fd55afc24bfa0812df572c747a1f1f1a1670 Auto-Submitted: auto-generated Date: Fri, 20 Nov 2026 12:04:50 +0000 Message-Id: <6b003762.52af.e3154b@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d298fd55afc24bfa0812df572c747a1f1f1a1670 commit d298fd55afc24bfa0812df572c747a1f1f1a1670 Author: Dag-Erling Smørgrav AuthorDate: 2026-11-15 16:35:28 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-11-20 12:04:05 +0000 stdio: Fix positional %B / %b conversion MFC after: 1 week Fixes: d9dc1603d6e4 ("libc: Implement N2630.") Fixes: b9385720f34b ("libc: Add unit tests for N2630 and possible collateral damage.") (cherry picked from commit 0e3fce268adeec8f4c87b99759dae6a592b3d365) --- lib/libc/stdio/printf-pos.c | 10 ++++++++++ lib/libc/tests/stdio/snprintf_test.c | 2 ++ lib/libc/tests/stdio/swprintf_test.c | 2 ++ 3 files changed, 14 insertions(+) diff --git a/lib/libc/stdio/printf-pos.c b/lib/libc/stdio/printf-pos.c index 394ec98e7e85..722d267c6481 100644 --- a/lib/libc/stdio/printf-pos.c +++ b/lib/libc/stdio/printf-pos.c @@ -345,6 +345,11 @@ reswitch: switch (ch) { case 'z': flags |= SIZET; goto rflag; + case 'B': + case 'b': + if ((error = adduarg(&types, flags))) + goto error; + break; case 'C': flags |= LONGINT; /*FALLTHROUGH*/ @@ -539,6 +544,11 @@ reswitch: switch (ch) { case 'z': flags |= SIZET; goto rflag; + case 'B': + case 'b': + if ((error = adduarg(&types, flags))) + goto error; + break; case 'C': flags |= LONGINT; /*FALLTHROUGH*/ diff --git a/lib/libc/tests/stdio/snprintf_test.c b/lib/libc/tests/stdio/snprintf_test.c index c8f04b7e5524..d5f056b9542d 100644 --- a/lib/libc/tests/stdio/snprintf_test.c +++ b/lib/libc/tests/stdio/snprintf_test.c @@ -46,6 +46,7 @@ ATF_TC_BODY(snprintf_b, tc) SNPRINTF_TEST(" 0b1", "%#12b", 1); SNPRINTF_TEST("0b0000000001", "%#012b", 1); SNPRINTF_TEST("0b1111111111111111111111111111111", "%#b", INT_MAX); + SNPRINTF_TEST("0b0011", "%1$#05jb%b", (uintmax_t)1, 1); } ATF_TC_WITHOUT_HEAD(snprintf_B); @@ -65,6 +66,7 @@ ATF_TC_BODY(snprintf_B, tc) SNPRINTF_TEST(" 0B1", "%#12B", 1); SNPRINTF_TEST("0B0000000001", "%#012B", 1); SNPRINTF_TEST("0B1111111111111111111111111111111", "%#B", INT_MAX); + SNPRINTF_TEST("0B0011", "%1$#05jB%B", (uintmax_t)1, 1); } ATF_TC_WITHOUT_HEAD(snprintf_d); diff --git a/lib/libc/tests/stdio/swprintf_test.c b/lib/libc/tests/stdio/swprintf_test.c index fe2957928344..5d9c60fb9ee7 100644 --- a/lib/libc/tests/stdio/swprintf_test.c +++ b/lib/libc/tests/stdio/swprintf_test.c @@ -47,6 +47,7 @@ ATF_TC_BODY(swprintf_b, tc) SWPRINTF_TEST(" 0b1", "%#12b", 1); SWPRINTF_TEST("0b0000000001", "%#012b", 1); SWPRINTF_TEST("0b1111111111111111111111111111111", "%#b", INT_MAX); + SWPRINTF_TEST("0b0011", "%1$#05jb%b", (uintmax_t)1, 1); } ATF_TC_WITHOUT_HEAD(swprintf_B); @@ -66,6 +67,7 @@ ATF_TC_BODY(swprintf_B, tc) SWPRINTF_TEST(" 0B1", "%#12B", 1); SWPRINTF_TEST("0B0000000001", "%#012B", 1); SWPRINTF_TEST("0B1111111111111111111111111111111", "%#B", INT_MAX); + SWPRINTF_TEST("0B0011", "%1$#05jB%B", (uintmax_t)1, 1); } ATF_TC_WITHOUT_HEAD(swprintf_d);