diff mbox series

libtraceevent: Fix %zd and %Zd processing

Message ID 20220223160318.09b7c4eb@gandalf.local.home (mailing list archive)
State Superseded
Headers show
Series libtraceevent: Fix %zd and %Zd processing | expand

Commit Message

Steven Rostedt Feb. 23, 2022, 9:03 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The 'z' option in printf is to handle the long case. To print as 32 bit on
32 bit architectures and 64 bit on 64 bit architectures. But currently it
is simply ignored in the printf formatting.

Reported-by: Chuck Lever III <chuck.lever@oracle.com>
Fixes: 6582b0aea1cc ("tools/events: Add files to create libtraceevent.a")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 src/event-parse.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/event-parse.c b/src/event-parse.c
index de28b3be9955..124166909589 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -5713,9 +5713,11 @@  static int parse_arg_format(struct tep_print_parse **parse,
 		case 'L':
 			ls = 2;
 			break;
-		case '.':
 		case 'z':
 		case 'Z':
+			ls = 1;
+			break;
+		case '.':
 		case '0' ... '9':
 		case '-':
 			break;