Re: git: fc3e5334ab89 - main - Fix "%hhi" conversion for kvprintf()

From: Warner Losh <imp_at_bsdimp.com>
Date: Sat, 13 Jul 2024 14:57:20 UTC
On Fri, Jun 28, 2024 at 9:13 AM Konstantin Belousov <kostikbel@gmail.com>
wrote:

> On Fri, Jun 28, 2024 at 03:00:54PM +0000, Warner Losh wrote:
> > The branch main has been updated by imp:
> >
> > URL:
> https://cgit.FreeBSD.org/src/commit/?id=fc3e5334ab891eab22a4278384be6f9b74d6d91a
> >
> > commit fc3e5334ab891eab22a4278384be6f9b74d6d91a
> > Author:     Sebastian Huber <sebastian.huber@embedded-brains.de>
> > AuthorDate: 2024-06-13 11:01:31 +0000
> > Commit:     Warner Losh <imp@FreeBSD.org>
> > CommitDate: 2024-06-28 14:57:39 +0000
> >
> >     Fix "%hhi" conversion for kvprintf()
> >
> >     The signedness of "char" is implementation-dependent.
> >
> >     Reviewed by: imp,zlei,nightquick@proton.me
> >     Pull Request: https://github.com/freebsd/freebsd-src/pull/1290
> > ---
> >  sys/kern/subr_prf.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
> > index e291a1fa00a6..4dc989e2d1f1 100644
> > --- a/sys/kern/subr_prf.c
> > +++ b/sys/kern/subr_prf.c
> > @@ -904,7 +904,7 @@ handle_sign:
> >                       else if (hflag)
> >                               num = (short)va_arg(ap, int);
> >                       else if (cflag)
> > -                             num = (char)va_arg(ap, int);
> > +                             num = (signed char)va_arg(ap, int);
> >                       else
> >                               num = va_arg(ap, int);
> >  number:
> Isn't the same fix needed for libexec/rtld-elf/rtld_printf.c ?
>

Oh I believe that it is. The code is different in appearance, but it's
clear that this is needed there too... I'm a little behind on things, but I
hadn't forgotten.

Warner