From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.formilux.org (mta1.formilux.org [51.159.59.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3ECCC2066DE for ; Sat, 7 Mar 2026 10:46:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=51.159.59.229 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772880378; cv=none; b=mhNPkpnfBy25e6zQ7DbC/ZkGiy9Ny1m44CJL2WZBfYrj3ahwTuPALuipJzE0e9iMGodq6hG8NUMmB71nUYqj63PP13OdTzPa3vCfZLllUBtE5R40P+IOVhbaNxbaRNT79T39zSKMOCG3/GxOBXK77iq+RpbPQGL9bvWpxzAVeD0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772880378; c=relaxed/simple; bh=uNU0ReH+vUN7bbsxkMFDNDgz7NCTkn8zhFUvasz8WYk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GB6/nSkil0J9oqA8Ev1Vm03ANrtcvmKqL3S28va14C3edqBXPRYcSx81WFpkzDfByPwSlwtxsnzTAFK4VixpFRgsiYZklhx3wV3moc9NVqVIkK9xrHApRM8hGv7ETDYVpasg6vFLM/lpkdGfATs9WZKuEdQM7AdoacDKtTmw59o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu; spf=pass smtp.mailfrom=1wt.eu; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b=DGlvIFbb; arc=none smtp.client-ip=51.159.59.229 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=1wt.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b="DGlvIFbb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1wt.eu; s=mail; t=1772880375; bh=cqyQ7NOll2BDb8dFDkInPvfjeVZ1UTADkd6oRHZsUtQ=; h=From:Message-ID:From; b=DGlvIFbbHemkBNkF8Crb19+G2bS7cXisnvIZ9TuGFyUt6I7kEi4bmQO5LsA6iupwu Idy5M15bRSCiDYLXvLHXjjBIcrjQINaX9IS/BbsnLVFRj0N8jmQoyd4V3ncvTdnDDR DSqlz/hOK/N/dLkqzunGkdpO+bocKj18SRubWQ8k= Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by mta1.formilux.org (Postfix) with ESMTP id 957D7C0A05; Sat, 07 Mar 2026 11:46:15 +0100 (CET) Date: Sat, 7 Mar 2026 11:46:15 +0100 From: Willy Tarreau To: david.laight.linux@gmail.com Cc: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , linux-kernel@vger.kernel.org, Cheng Li Subject: Re: [PATCH v4 next 18/23] tools/nolibc/printf: Add support for conversion flags space and plus Message-ID: References: <20260302101815.3043-1-david.laight.linux@gmail.com> <20260302101815.3043-19-david.laight.linux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260302101815.3043-19-david.laight.linux@gmail.com> On Mon, Mar 02, 2026 at 10:18:10AM +0000, david.laight.linux@gmail.com wrote: > From: David Laight > > Flags ' ' and '+' are sign characters for positive numbers. > > Signed-off-by: David Laight Acked-by: Willy Tarreau willy > --- > > v4: Split from the previous patch and support for the # flag. > > tools/include/nolibc/stdio.h | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/stdio.h > index fb310b7d023f..5d75e8530ce2 100644 > --- a/tools/include/nolibc/stdio.h > +++ b/tools/include/nolibc/stdio.h > @@ -296,7 +296,7 @@ int fseek(FILE *stream, long offset, int whence) > * - %% generates a single % > * - %m outputs strerror(errno). > * - %X outputs a..f the same as %x. > - * - The modifiers [#-+ 0] are currently ignored. > + * - The modifiers [#-0] are currently ignored. > * - No support for precision or variable widths. > * - No support for floating point or wide characters. > * - Invalid formats are copied to the output buffer. > @@ -456,6 +456,10 @@ int __nolibc_printf(__nolibc_printf_cb cb, void *state, const char *fmt, va_list > sign_prefix = '-'; > v = -(signed_v + 1); > v++; > + } else if (_NOLIBC_PF_FLAGS_CONTAIN(flags, '+')) { > + sign_prefix = '+'; > + } else if (_NOLIBC_PF_FLAGS_CONTAIN(flags, ' ')) { > + sign_prefix = ' '; > } > } > > -- > 2.39.5