HomeFreeBSD

kvprintf(): Fix '+' conversion handling

Description

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

Details

Provenance
sebastian.huber_embedded-brains.deAuthored on Jun 14 2024, 7:30 AM
impCommitted on Sep 6 2024, 6:34 PM
Parents
rGf5a58c2da239: linux80211: fix default deflink.rx_nss
Branches
Unknown
Tags
Unknown