]> git.ipfire.org Git - thirdparty/openssl.git/commit
crypto/bio/bio_print.c: handle negative width argument
authorEugene Syromiatnikov <esyr@openssl.org>
Tue, 5 Aug 2025 12:53:28 +0000 (14:53 +0200)
committerNeil Horman <nhorman@openssl.org>
Fri, 29 Aug 2025 16:18:30 +0000 (12:18 -0400)
commit7eb18e768dbec07dbac7e883629c5d5875c7f7b8
treeb44191af7205d909bb30e6253e14eea7c00ab73a
parent96e021dffff9a5382e3b9d68f55a0e538ae0dea1
crypto/bio/bio_print.c: handle negative width argument

Per [1]:

    A negative field width is taken as a '-' flag followed by a positive field
    width.

So, printf("%-*d", -12, 34) should lead to a 123-wide left-aligned output,
"34          ".

[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