[PATCH 0/1] MR4106: include: Fix debugstr_fourcc printf format to print at most 4 chars.
From: Rémi Bernon <rbernon(a)codeweavers.com> --- include/wine/debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wine/debug.h b/include/wine/debug.h index d0862942be8..70fab5a247b 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -330,7 +330,7 @@ static inline const char *wine_dbgstr_fourcc( unsigned int fourcc ) if (!fourcc) return "''"; if (isprint( str[0] ) && isprint( str[1] ) && isprint( str[2] ) && isprint( str[3] )) - return wine_dbg_sprintf( "'%4s'", str ); + return wine_dbg_sprintf( "'%.4s'", str ); return wine_dbg_sprintf( "0x%08x", fourcc ); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4106
Alex Henrie (@alexhenrie) commented about include/wine/debug.h:
if (!fourcc) return "''"; if (isprint( str[0] ) && isprint( str[1] ) && isprint( str[2] ) && isprint( str[3] )) - return wine_dbg_sprintf( "'%4s'", str ); + return wine_dbg_sprintf( "'%.4s'", str );
If all four characters are printable, how is %.4s different from %4s? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4106#note_48829
On Mon Oct 16 18:44:09 2023 +0000, Alex Henrie wrote:
If all four characters are printable, how is %.4s different from %4s? Never mind, I didn't realize that %4s means a _minimum_ of 4 characters and %.4s means a _maximum_ of 4.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4106#note_48830
This merge request was approved by Alex Henrie. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4106
participants (2)
-
Alex Henrie (@alexhenrie) -
Rémi Bernon