From nobody Fri Nov 20 12:04:34 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 4jWDXf6MCyz71X3H for ; Fri, 20 Nov 2026 12:04:34 +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 4jWDXf23jSz3QNp for ; Fri, 20 Nov 2026 12:04:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795176274; 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=QSQvkBciyZS47m5USzEmaXn/2EUSqn2jIezEhbdq9YY=; b=c3YqNJ8+0gmtFd79wFOczhkUPG+/36IcmOc3XP27enY/+TegCJujkCNkp3PtDdXy4AFhlY kIJzplVYeUoEvr7oS5TljT2j1kS8GEIGiKsVp1Lb86K40sI7H/pdVRSMqyDrJJcUEGCIdi y+sXbMdETjc3Q6Mym5OEgLk/NMwYbc/rLgq8CiHYgUqmxE1v9e5ZqULkQ749caN+73VRUc bykdhY42GEXNLFkHmUJrDolnnHmOFaHpsHLvKnnBi09MICEyNyS8Bwb1rIDld5JdJjOus1 efiLJQjjzGfaK9eF+egY47GKjmq6aJ5rNeOQflPlWyvMJpIplKuxbq9osjJ0rw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795176274; b=k3qWjku2FEM7Nl0onxPfsIHk9fcmUtUxIOQnXhKhW9m/r4Ewwzj0q04KrY1pmlyZ4KCxIu RLXSwoIAdDOjE6cCvtjQCIYBJ40kU2dQGNj/ul+q/uuDc8dGaZrAHcU2ZC9JDUoipb9j8d bzkcmyjKKYff4rA/76flM9Qa1OHyxtC68isayVlHpti+e5ilq5nAE+xh0GimQkFpFcVWE5 xMcNbL4JWxMkavUeHxlGDUsg0u+cA1ON4c0uPzpj4W+xAbGAOYZJhXmstvTW6SAGNbKzHK iVj33F0Zv+7wBolWPqR7+V1cghiOS8MwpihfGrTpJi+OkV8X7XelLe7EdRVqVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795176274; 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=QSQvkBciyZS47m5USzEmaXn/2EUSqn2jIezEhbdq9YY=; b=CrXRODbLJ9ftLTrge2fr3nF5+CodgNlqUlkWjOM6au865YunlkyVvAmTPXhJGdDF4G4usG DITCeGibk5tkRyRWgEp9MbaDp3EgjbHmaSMEIBfmL/lzD4uMRO2Iku4AkH6qgjf489/GLq 3IusWIHwke1LLuieo/mvcJDqS3NbvrWg8iiLCDW0z35pPWzQtKvN314sLN0RxeJv8odkVh eXGvf8KSGMg2IvlkOpPeaIp+xWsHnuaUutv6MifECwT14OqMmwSTbxB7Uqfsio5rHdNY+W wVf8DR4aomHKOtyU8SgzVMvHrigXaRH8sXBwaod3xOS4XC9n5Gn7FSqBbujKDg== 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 4jWDXf19xTznNh for ; Fri, 20 Nov 2026 12:04:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f77 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 20 Nov 2026 12:04:34 +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: 65ea18b09789 - stable/15 - 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/15 X-Git-Reftype: branch X-Git-Commit: 65ea18b09789e0349c6153e7512c0f8fbab77f4e Auto-Submitted: auto-generated Date: Fri, 20 Nov 2026 12:04:34 +0000 Message-Id: <6b003752.3f77.7e039145@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=65ea18b09789e0349c6153e7512c0f8fbab77f4e commit 65ea18b09789e0349c6153e7512c0f8fbab77f4e Author: Dag-Erling Smørgrav AuthorDate: 2026-11-15 16:35:28 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-11-20 12:03:55 +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 07b518c59214..27b59f25b67d 100644 --- a/lib/libc/stdio/printf-pos.c +++ b/lib/libc/stdio/printf-pos.c @@ -340,6 +340,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*/ @@ -530,6 +535,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);