From nobody Mon Nov 16 12:29:00 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 4jSnGh3fzrz70WQF for ; Mon, 16 Nov 2026 12:29:00 +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 4jSnGh36bFz3CB5 for ; Mon, 16 Nov 2026 12:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794832140; 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=7Hh7nYKVL0IcqUgK7/Vs++W7/APPMhtyouSXjayJQRM=; b=gCEMgnx/e0SycXjbixbAV/Mr/7OBYeWiof/DWMgd5UqeBYcMvWO96MI/rL/Q8d62osXddC BDDxlJ2r6rDDBZNWHWhLQud7Nr8yqzcUmoxj/YSe14y6GAedG/N/i84fXE+a5sWIwfo/D7 BS9UWD9rdANr53D0YKaREFR7D9vfI0niELlmOuCt0yoluGJZx/zMcxyQvNBGC9ZTA0h0mf m612QfXkAQAGxzqRugZxbiK634+49m4Sm22ARKaUFrK18gaUdR+b5qZ3J3GOvG9NeXrhmO GUI8oq0FoLP57uomSwtWOc3CsRwtNsfiFU+XOwhBNJaQKI7D7OQ7QGMQrVE2oA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794832140; b=qKmyZY2A0M0W8kjM0GS9zCfr8JizOU4NPBR91aK9ado2cwg4HEmco3NIGefoAc8q8najxR Tmx0+XsA8xiY0en9RD9oHdLSXydp3+8YzK6AOH/EEYgyXiyyq9SljHS+sRwmaLh2O7cuvC PDw5GILz/+7JD4AKKModJ5QB9tbvpHemhrKIVepcYKPP3KlHBpoqQ2JUD68KgcT97WXIv3 Re9rg3e1fndjcQHUyENJ/R8vfVYnDQtBTC9MuXUipm2CS3K7HnPzcQeBuMDqXZ/N9Umyri gL1H4zvinLbhdd6Xq0TEQboEzRmTXcYqHCsYo/XRPa+8KE1J5XmPVRe78qSBnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794832140; 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=7Hh7nYKVL0IcqUgK7/Vs++W7/APPMhtyouSXjayJQRM=; b=VpGtEb46Q51ETDGMDcpRXLmRgq57LwiLm6sPKzi6iFbALolbmg8FOqqpl4u5+hKoHPoRt+ hIigEw/ydxyjQtMfvN8I8ScN3m19S8JwEeGYURyC/MUspYkv68FSKSbQFUH38/k9sTJdjT uiwtLypyQp7FhigDZjcLl8hMHmTaI1V9f1hol2EXnU8Ycyp3J5Upyuodef4oDWQbZH8pXj ErWh1QsuEaAz3jH5fQFn8JzVBOgJ+j0gOa+Gi4A7DrYdhLI5cU/312BNdc4o5qn76txNNW 2xMeKGlqvP+xEtnrGAAwVQjj3+FfodRj5KGDA3hn4oe08xkwzP5zSaMTmipQaA== 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 4jSnGh2n5Cztd1 for ; Mon, 16 Nov 2026 12:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19785 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 16 Nov 2026 12:29:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 0bf5d86620d0 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 0bf5d86620d047b4551d7414bf8011a328264b3d Auto-Submitted: auto-generated Date: Mon, 16 Nov 2026 12:29:00 +0000 Message-Id: <6afaf70c.19785.4b3ce676@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0bf5d86620d047b4551d7414bf8011a328264b3d commit 0bf5d86620d047b4551d7414bf8011a328264b3d Author: Dag-Erling Smørgrav AuthorDate: 2026-11-16 11:45:15 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-11-16 12:05:54 +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") --- 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)