Skip to contentSkip to conversation

libtraceevent: Handel printf '%+d" case

PATCH New Steven Rostedt 1 participant 1 message Jun 1, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtraceevent: Handel printf '%+d" case

From: "Steven Rostedt (Google)" <[email protected]>

The print prasing does not handle '%+d' and prints ">+<d" instead. The '+' is a valid printf specifier. Make sure to handle it.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=217339

---
 src/event-parse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/event-parse.c +2 -2
index 12c6f56..b4191eb 100644
@@ -5179,10 +5179,9 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
 				ls = 2;
 				goto process_again;
 			case '0' ... '9':
-				goto process_again;
 			case '.':
-				goto process_again;
 			case '#':
+			case '+':
 				goto process_again;
 			case 'z':
 			case 'Z':
@@ -6443,6 +6442,7 @@ static int parse_arg_format(struct tep_print_parse **parse,
 		case '.':
 		case '0' ... '9':
 		case '-':
+		case '+':
 			break;
 		case '*':
 			/* The argument is the length. */
Signature · 1 line
2.35.1