RTEMS | kvprintf(): Fix '+' conversion handling (!214)

Sebastian Huber (@sebhub) gitlab at rtems.org
Thu Sep 12 00:24:11 UTC 2024



Sebastian Huber created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/214

Project:Branches: sebhub/rtems:iovprintf to rtems/rtos/rtems:main
Author:   Sebastian Huber
Assignee: Sebastian Huber



## Summary

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


<!-- Default settings, if it is a dropdown it will set after submission -->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/214
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240912/a896ef72/attachment-0001.htm>


More information about the bugs mailing list