Re: git: 07d90ee0a621 - main - kvprintf(): Fix '+' conversion handling
- In reply to: Konstantin Belousov : "Re: git: 07d90ee0a621 - main - kvprintf(): Fix '+' conversion handling"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 22 Sep 2024 16:52:43 UTC
On Fri, Sep 6, 2024 at 10:47 PM Konstantin Belousov <kostikbel@gmail.com>
wrote:
> On Fri, Sep 06, 2024 at 03:14:49PM -0600, Warner Losh wrote:
> > On Fri, Sep 6, 2024 at 2:53 PM Konstantin Belousov <kostikbel@gmail.com>
> > wrote:
> >
> > > On Fri, Sep 06, 2024 at 06:35:09PM +0000, Warner Losh wrote:
> > > > The branch main has been updated by imp:
> > > >
> > > > URL:
> > >
> https://cgit.FreeBSD.org/src/commit/?id=07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad
> > > >
> > > > commit 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad
> > > > Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
> > > > AuthorDate: 2024-06-14 07:30:28 +0000
> > > > Commit: Warner Losh <imp@FreeBSD.org>
> > > > CommitDate: 2024-09-06 18:34:30 +0000
> > > >
> > > > kvprintf(): Fix '+' conversion handling
> > > >
> > > > For example, printf("%+i", 1) prints "+1". However, kvprintf()
> did
> > > > print just "1" for this example. According to PRINTF(3):
> > > >
> > > > A sign must always be placed before a number produced by a
> signed
> > > > conversion.
> > > >
> > > > For "%+r" radix conversions, keep the "+" handling as it is,
> since
> > > this
> > > > is a non-standard conversion. For "%+p" pointer conversions,
> > > continue
> > > > to ignore the sign modifier to be in line with libc.
> > > >
> > > > This change allows to support the ' conversion modifier in the
> > > future.
> > > >
> > > > Reviewed by: imp
> > > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1310
> > > > ---
> > > > sys/kern/subr_prf.c | 27 +++++++++++++--------------
> > > > 1 file changed, 13 insertions(+), 14 deletions(-)
> > > Again, isn't rtld_printf needs the same change?
> > >
> >
> > This time I don't think so. I'll double check though. I'd checked when
> this
> > came in. Thanks for the reminder.
> It would be weird if not needed, rtld_printf.c was a copy of subr_prf.c.
>
Yes. It's required. I've updated and committed. Thanks again for the
reminder.
I must have been confused when I thought it wasn't needed, since it isn't
even
a close call looking at it just now.
Warner