]> git.ipfire.org Git - thirdparty/openssl.git/commit
crypto/bio/bio_print.c: no prefix for zero value in alternative form
authorEugene Syromiatnikov <esyr@openssl.org>
Tue, 5 Aug 2025 13:11:08 +0000 (15:11 +0200)
committerNeil Horman <nhorman@openssl.org>
Fri, 29 Aug 2025 16:18:30 +0000 (12:18 -0400)
commit0f6e826f7b70770935b3766efad05d7755a74edc
tree5d434b8305e73890ba11b5ae19bf928d081e8c96
parent7eb18e768dbec07dbac7e883629c5d5875c7f7b8
crypto/bio/bio_print.c: no prefix for zero value in alternative form

Per [1] (emphasis is added):

    - For o conversion, it shall increase the precision,
      **if and only if necessary**, to force the first digit of the result
      to be a zero (**if the value and precision are both 0,
      a single 0 is printed**).
    - For x or X conversion specifiers, a **non-zero** result shall have
      0x (or 0X) prefixed to it.

[1] https://pubs.opengroup.org/onlinepubs/9799919799//functions/printf.html

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28177)
crypto/bio/bio_print.c