[Midnightbsd-cvs] [MidnightBSD/src] effae9: kvprintf(): Fix '+' conversion handling

Lucas Holt noreply at github.com
Mon Mar 31 15:26:50 EDT 2025


  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/src
  Commit: effae981f68af7d274232586481bdb6ed43b96f2
      https://github.com/MidnightBSD/src/commit/effae981f68af7d274232586481bdb6ed43b96f2
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2025-03-31 (Mon, 31 Mar 2025)

  Changed paths:
    M sys/kern/subr_prf.c

  Log Message:
  -----------
  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.

Obtained from: FreeBSD current



To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/src/settings/notifications


More information about the Midnightbsd-cvs mailing list