From nobody Wed Mar 26 01:29:05 2025 X-Original-To: dev-commits-src-branches@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 4ZMq2C0GJbz5s5xQ; Wed, 26 Mar 2025 01:29:07 +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 4ZMq296KQCz3rm1; Wed, 26 Mar 2025 01:29:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742952546; 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=8j//8aDzB1m14m+mznDTrYtD5JkNfXAi1x1eKupnt3Q=; b=JJcs2HwD5AXLsAb0ZJfr+hazuBon/1Qxciqp25ZXXbcjqFYGKBD0PwFVaNQvQOU82R8Bva blwldQSUjZfxwTExfYctnSL+g9nRZMZbA3T4Qv/lOyYK8w/fpLIVn+VTLOtL0ks1vxedlG hpKQsvTFhVUDbY7/I0L8nIm13dbLx7mhWf+XV46DsI5XXUoxYavDqIjtsma1cdCvO6OJNI Rq7zGwudfAz8290F3nAiz2D/V+LRTM2AsvMaDNq94zq3SZv52WUI4QLBi3T98F3Rqen+JJ NjK/A+iQLC3C/XKhR44nj10bFmUxpkkPdG0BcmVLDm2WWpEe4QT9s6pN/89/8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1742952546; a=rsa-sha256; cv=none; b=L9LVxbfVjFEgWnwnWGXKQD3VngpRjfvZId9uIbXTTgR5a7c+qoPVVeBLCflNhn/uM/eGA5 s3jaWgEhZ/CaJYBLkn/L/lUXXlea3EwKGz2afEiyd/KLJZDCWvGKXuvATvgGzeBVMIgRFG GChv4Jvx42Quyc4xo3/Bsgo1Zqs9kLkKe6/ZnJsokG+1c/TGz3AA0FUhj/bHYFttR0h22J vheeBvSwiU0KHywyFIkkcDi24Che6cD/vdP0uXcXpYpMW9PFQ40tcYV9wl5Rd1cY26vbP9 t/fi0SrdiVVrHoNEhAoOVsunxbjfC85ieWWDS0fdKcWlI2G/x6AgbnETgzhRow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742952546; 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=8j//8aDzB1m14m+mznDTrYtD5JkNfXAi1x1eKupnt3Q=; b=TTYDHxwPHEJBj8WlhI6oBLNV5TXRZ++ejW4j1wZ36TXisPyZj872x1xFpcruYkRYrTe9Nv KfHDbha+08IzOGFj+RJKe76yp72qDw8IyCqDaBn3k4LiNgihs7jfq/J+k4aCzGqd0s8Rje 67fFopTWWZKRx7roHK0ZULkIPXxSpbU0tnavcJwQtvaLYb7DCPi6YTpm5IGrQaGmq6H63A huGvfcrGJHRonMRJmfOKXsJgTbbHdPJeqL7YZjXkofU7y2sUbX9uQBB2C0udbl24aSlo85 OvD4OGdLiowGX7rBLmgXP5IRY/3CSBKUpkoOg9xIpW2BZzzeyOxtOu226UdNVw== 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 4ZMq295t5rz14Kw; Wed, 26 Mar 2025 01:29:05 +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 52Q1T5xl047462; Wed, 26 Mar 2025 01:29:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52Q1T5rB047459; Wed, 26 Mar 2025 01:29:05 GMT (envelope-from git) Date: Wed, 26 Mar 2025 01:29:05 GMT Message-Id: <202503260129.52Q1T5rB047459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 2ce4f021827a - stable/14 - libc/stdio: Increase BUF in vfprintf.c and vfwprintf.c List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2ce4f021827a718005e44db693ee5aee7ed175b9 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2ce4f021827a718005e44db693ee5aee7ed175b9 commit 2ce4f021827a718005e44db693ee5aee7ed175b9 Author: Ahmad Khalifa AuthorDate: 2024-08-31 03:42:04 +0000 Commit: Warner Losh CommitDate: 2025-03-26 01:28:39 +0000 libc/stdio: Increase BUF in vfprintf.c and vfwprintf.c With the %b format specifier we need enough space to write a uintmax_t in binary. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1400 (cherry picked from commit d4f9e326393e3298062a58338e2c94ef6baff8b5) --- lib/libc/stdio/vfprintf.c | 8 ++------ lib/libc/stdio/vfwprintf.c | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 72178c31aa94..6a1ce394a6cd 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -294,13 +294,9 @@ vfprintf(FILE * __restrict fp, const char * __restrict fmt0, va_list ap) /* * The size of the buffer we use as scratch space for integer * conversions, among other things. We need enough space to - * write a uintmax_t in octal (plus one byte). + * write a uintmax_t in binary. */ -#if UINTMAX_MAX <= UINT64_MAX -#define BUF 32 -#else -#error "BUF must be large enough to format a uintmax_t" -#endif +#define BUF (sizeof(uintmax_t) * CHAR_BIT) /* * Non-MT-safe version diff --git a/lib/libc/stdio/vfwprintf.c b/lib/libc/stdio/vfwprintf.c index b606eec0d9a4..67b366439618 100644 --- a/lib/libc/stdio/vfwprintf.c +++ b/lib/libc/stdio/vfwprintf.c @@ -374,13 +374,9 @@ vfwprintf(FILE * __restrict fp, const wchar_t * __restrict fmt0, va_list ap) /* * The size of the buffer we use as scratch space for integer * conversions, among other things. We need enough space to - * write a uintmax_t in octal (plus one byte). + * write a uintmax_t in binary. */ -#if UINTMAX_MAX <= UINT64_MAX -#define BUF 32 -#else -#error "BUF must be large enough to format a uintmax_t" -#endif +#define BUF (sizeof(uintmax_t) * CHAR_BIT) /* * Non-MT-safe version