mirror of https://github.com/openssl/openssl.git
crypto/bio/bio_print.c: correctly print 0X prefix for X conversion
Per [1]: 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>
This commit is contained in:
parent
cedcbea0e7
commit
1cf14d6af6
|
@ -473,7 +473,7 @@ fmtint(char **sbuffer,
|
||||||
if (base == 8)
|
if (base == 8)
|
||||||
prefix = "0";
|
prefix = "0";
|
||||||
if (base == 16)
|
if (base == 16)
|
||||||
prefix = "0x";
|
prefix = flags & DP_F_UP ? "0X" : "0x";
|
||||||
}
|
}
|
||||||
if (flags & DP_F_UP)
|
if (flags & DP_F_UP)
|
||||||
caps = 1;
|
caps = 1;
|
||||||
|
|
Loading…
Reference in New Issue