test/bioprinttest.c: fix sloppy length modifier usage in int_data

Some test vectors used in int_data have mismatching (or, more
spercifically) missing length modifiers in conversion specifiers;
most of the time it has gone unnoticed, but on some architectures where
64-bit arguments supplied differently (sugh as mips and armv7) it led
to garbage being retrieved instead of the expected values.  Fix it
by properly providing proper length modifiers.

Fixes: 9deaf83833 "test/bioprinttest.c: add some checks for integer and string printing"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28388)
This commit is contained in:
Eugene Syromiatnikov 2025-08-29 19:39:53 +02:00 committed by Neil Horman
parent 7903702280
commit e489bfbcd5
1 changed files with 11 additions and 11 deletions

View File

@ -159,7 +159,7 @@ static const struct int_data {
{ { .hh = 0x95 }, AT_CHAR, "%#06hhi", "-00107" },
{ { .hh = 0x4 }, AT_CHAR, "%# hhd", " 4" },
{ { .hh = 0x3 }, AT_CHAR, "%# hhu", "3" },
{ { .hh = 0x0 }, AT_CHAR, "%02x", "00" },
{ { .hh = 0x0 }, AT_CHAR, "%02hhx", "00" },
{ { .h = 0 }, AT_SHORT, "|%.0hd|", "||" },
{ { .h = 0 }, AT_SHORT, "|%.hu|", "||" },
{ { .h = 0 }, AT_SHORT, "|%#.ho|", "|0|" },
@ -215,16 +215,16 @@ static const struct int_data {
{ { .i = 0x1337 }, AT_INT, "%4294967302.x", "",
.skip_libc_check = true, .exp_ret = -1 },
{ { .i = 0xbeeface }, AT_INT, "%#+-12.1d", "+200211150 " },
{ { .l = 0 }, AT_LONG, "%%%#.0o%%", "%0%" },
{ { .l = 0 }, AT_LONG, "%%%.0o%%", "%%" },
{ { .l = 0 }, AT_LONG, "%%%-.0o%%", "%%" },
{ { .l = 0xfacefed }, AT_LONG, "%#-1.14d", "00000262991853" },
{ { .l = 0xdefaced }, AT_LONG, "%#+-014.11i", "+00233811181 " },
{ { .l = 0xfacade }, AT_LONG, "%#0.14o", "00000076545336" },
{ { .l = 0 }, AT_LONG, "%#0.14o", "00000000000000" },
{ { .l = 0xfacade }, AT_LONG, "%#0.14x", "0x00000000facade" },
{ { .ll = 0 }, AT_LLONG, "#%#.0x#", "##" },
{ { .ll = 0 }, AT_LLONG, "#%.0x#", "##" },
{ { .l = 0 }, AT_LONG, "%%%#.0lo%%", "%0%" },
{ { .l = 0 }, AT_LONG, "%%%.0lo%%", "%%" },
{ { .l = 0 }, AT_LONG, "%%%-.0lo%%", "%%" },
{ { .l = 0xfacefed }, AT_LONG, "%#-1.14ld", "00000262991853" },
{ { .l = 0xdefaced }, AT_LONG, "%#+-014.11li", "+00233811181 " },
{ { .l = 0xfacade }, AT_LONG, "%#0.14lo", "00000076545336" },
{ { .l = 0 }, AT_LONG, "%#0.14lo", "00000000000000" },
{ { .l = 0xfacade }, AT_LONG, "%#0.14lx", "0x00000000facade" },
{ { .ll = 0 }, AT_LLONG, "#%#.0llx#", "##" },
{ { .ll = 0 }, AT_LLONG, "#%.0llx#", "##" },
{ { .ll = 0xffffFFFFffffFFFFULL }, AT_LLONG, "%#-032llo",
"01777777777777777777777 " },
{ { .ll = 0xbadc0deddeadfaceULL }, AT_LLONG, "%022lld",