mirror of https://github.com/openssl/openssl.git
crypto/bio/bio_print.c: '-' flag has priority over '0'
Per [1]: If the '0' and '-' flags both appear, the '0' flag is ignored. [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)
This commit is contained in:
parent
0f107c709c
commit
95af148e14
|
@ -506,12 +506,12 @@ fmtint(char **sbuffer,
|
||||||
zpadlen = 0;
|
zpadlen = 0;
|
||||||
if (spadlen < 0)
|
if (spadlen < 0)
|
||||||
spadlen = 0;
|
spadlen = 0;
|
||||||
if (flags & DP_F_ZERO) {
|
if (flags & DP_F_MINUS) {
|
||||||
|
spadlen = -spadlen;
|
||||||
|
} else if (flags & DP_F_ZERO) {
|
||||||
zpadlen = OSSL_MAX(zpadlen, spadlen);
|
zpadlen = OSSL_MAX(zpadlen, spadlen);
|
||||||
spadlen = 0;
|
spadlen = 0;
|
||||||
}
|
}
|
||||||
if (flags & DP_F_MINUS)
|
|
||||||
spadlen = -spadlen;
|
|
||||||
|
|
||||||
/* spaces */
|
/* spaces */
|
||||||
while (spadlen > 0) {
|
while (spadlen > 0) {
|
||||||
|
|
Loading…
Reference in New Issue