From nobody Fri Nov 20 12:04:36 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 4jWDXh60Ggz71X7g for ; Fri, 20 Nov 2026 12:04:36 +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 4jWDXh3D9fz3QPH for ; Fri, 20 Nov 2026 12:04:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795176276; 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=oe4mYTOadhfEqSBnZSwHFYuOGzrX/QLAybrz2mLngy8=; b=dh+l+XH9Yl9BXxwwKw+2mkVPr7/fzM+YAuYvr/AU9nkZWeOr7MfsEDMYyRvmz8l4e7vboz L954te7upkV0c3R16t1jBmCHppRtMrn2BQ1T4PL3LPk1bds1dSVI0R6liQg8Dvvlvx30Au 4wOEmVU/7z++7KrlGuqH1HWaR6NJLD8rykmBtewxxKMqvKmqWdw5ZeiEdjIzp4VU+tE8A9 g3lKTC2wsTr0Hx8UlRpw0uMyIDNc/M9fpfErTg7yMvQPhCb7PbHeh5vtxj5yytDAM7zdOd vRpc5DTX14uiMi4OuTsGimdpJ1c1P4JhgoWZT3FxxnercpkzWZoXgt+VFvBaeQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795176276; b=iFs46uyBDeU8ZuRC9804nNgrFSAzeTqGkwJ5EHQcFvuDD7/t6ELjOOwLVqQ7Hng3q+hVu8 c8FVYYJZtdvKwVsRbiLOTWb8Ely0z457bdL5FJ/eUUddSCBEFnpwvStXtoSZlAzCZfXErv tCWOs4Hv6o4lGmiEtQC8K6pevlPk156hiP3gEB0SOWyZfCXEjN3hDOC8Mv2I1Xov2Yc2wC wRok35pOHon/LPoUGcSVN8BaEpQe7pX6t6+MDvUVBjcXTXv9sFRgbyVEUOeAiJNSEm8we6 HXiYGsHc/gnYZWA8hbzeUK3KVt38perjFptAj3QmFMUzgZoTitG1yA9LVNNlOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795176276; 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=oe4mYTOadhfEqSBnZSwHFYuOGzrX/QLAybrz2mLngy8=; b=ZZ+SSBT62/rE+DrgftrdXtFJNhtRg87p5UOAC+fzd1VLeRD9fBUSTohKM601PbZbVbVh/y zyvWC8lY9Ida2oRmiQRQAyClHOjH59wr0Fw3B9xu1v2kuqVnSIVMOI17lor0odJryzZv5I xYXsoDy6Yaa4yGXGMo2Eh1lYk3IA+bRs4kEZfg7OzyBaiPHcGqAb5gqXzKRz8bwzQWRh4Y Jt201pCGegymF6aIiunmGfYuiicLGhv1LXKlCLwfJ3/tZzN2X2CLHEORANkUsP6Ibq+sWH Jf/KrOUAyBteJvSRDuGe2f7+Co89DNaM7pnkZE2nSx+VFiARIl3k1WA+jG1zPg== 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 4jWDXh2FgzznmM for ; Fri, 20 Nov 2026 12:04:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e6b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 20 Nov 2026 12:04:36 +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: 24a13dd704a6 - stable/15 - stdio: Fix error case for positional %wN / %wfN 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: 24a13dd704a6b66e5423659558256d1733778702 Auto-Submitted: auto-generated Date: Fri, 20 Nov 2026 12:04:36 +0000 Message-Id: <6b003754.3e6b.6570f08@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=24a13dd704a6b66e5423659558256d1733778702 commit 24a13dd704a6b66e5423659558256d1733778702 Author: Dag-Erling Smørgrav AuthorDate: 2026-11-16 11:45:15 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-11-20 12:03:56 +0000 stdio: Fix error case for positional %wN / %wfN In the case were N was not a valid bit width, we were taking the wrong error path. Fixes: 5e809bf1c93f ("stdio: Fix positional %wN / %wfN conversion") (cherry picked from commit 0bf5d86620d047b4551d7414bf8011a328264b3d) --- lib/libc/stdio/printf-pos.c | 4 ++-- lib/libc/tests/stdio/snprintf_test.c | 2 ++ lib/libc/tests/stdio/swprintf_test.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdio/printf-pos.c b/lib/libc/stdio/printf-pos.c index fd92b3d5ad29..c395144dbd7d 100644 --- a/lib/libc/stdio/printf-pos.c +++ b/lib/libc/stdio/printf-pos.c @@ -368,7 +368,7 @@ reswitch: switch (ch) { flags &= ~FASTINT; fmt--; } - goto error; + break; } goto rflag; case 'z': @@ -597,7 +597,7 @@ reswitch: switch (ch) { flags &= ~FASTINT; fmt--; } - goto error; + break; } goto rflag; case 'z': diff --git a/lib/libc/tests/stdio/snprintf_test.c b/lib/libc/tests/stdio/snprintf_test.c index b805f513c402..392fb43f9795 100644 --- a/lib/libc/tests/stdio/snprintf_test.c +++ b/lib/libc/tests/stdio/snprintf_test.c @@ -175,6 +175,7 @@ ATF_TC_BODY(snprintf_wN, tc) SNPRINTF_TEST(" 1", "%1$*2$w16d", (int16_t)1, 2); SNPRINTF_TEST(" 1", "%1$*2$w32d", (int32_t)1, 2); SNPRINTF_TEST(" 1", "%1$*2$w64d", (int64_t)1, 2); + SNPRINTF_TEST("42w42d", "%1$d%w42d", 42); } ATF_TC_WITHOUT_HEAD(snprintf_wfN); @@ -211,6 +212,7 @@ ATF_TC_BODY(snprintf_wfN, tc) SNPRINTF_TEST(" 1", "%1$*2$w16d", (int_fast16_t)1, 2); SNPRINTF_TEST(" 1", "%1$*2$w32d", (int_fast32_t)1, 2); SNPRINTF_TEST(" 1", "%1$*2$w64d", (int_fast64_t)1, 2); + SNPRINTF_TEST("42wf42d", "%1$d%wf42d", 42); } ATF_TP_ADD_TCS(tp) diff --git a/lib/libc/tests/stdio/swprintf_test.c b/lib/libc/tests/stdio/swprintf_test.c index 6f3d56657f4c..6a9e68c9d5fd 100644 --- a/lib/libc/tests/stdio/swprintf_test.c +++ b/lib/libc/tests/stdio/swprintf_test.c @@ -176,6 +176,7 @@ ATF_TC_BODY(swprintf_wN, tc) SWPRINTF_TEST(" 1", "%1$*2$w16d", (int16_t)1, 2); SWPRINTF_TEST(" 1", "%1$*2$w32d", (int32_t)1, 2); SWPRINTF_TEST(" 1", "%1$*2$w64d", (int64_t)1, 2); + SWPRINTF_TEST("42w42d", "%1$d%w42d", 42); } ATF_TC_WITHOUT_HEAD(swprintf_wfN); @@ -212,6 +213,7 @@ ATF_TC_BODY(swprintf_wfN, tc) SWPRINTF_TEST(" 1", "%1$*2$w16d", (int_fast16_t)1, 2); SWPRINTF_TEST(" 1", "%1$*2$w32d", (int_fast32_t)1, 2); SWPRINTF_TEST(" 1", "%1$*2$w64d", (int_fast64_t)1, 2); + SWPRINTF_TEST("42wf42d", "%1$d%wf42d", 42); } ATF_TP_ADD_TCS(tp)