diff mbox series

libtracefs: Account for events with newlines in print fmt

Message ID 20220221151828.2fd4d104@rorschach.local.home (mailing list archive)
State Superseded
Headers show
Series libtracefs: Account for events with newlines in print fmt | expand

Commit Message

Steven Rostedt Feb. 21, 2022, 8:18 p.m. UTC
From: Steven Rostedt (Google) <rostedt@goodmis.org>

Some events in the kernel have a newline in the print fmt. Even though
that really is a bug in the kernel, libtraceevent should also be able
to handle it when it does happen.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---

Comments

Steven Rostedt Feb. 21, 2022, 8:39 p.m. UTC | #1
On Mon, 21 Feb 2022 15:18:28 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> Subject: [PATCH] libtracefs: Account for events with newlines in print fmt

This was suppose to be libtraceevent not libtracefs.

Will resend :-p

-- Steve
diff mbox series

Patch

diff --git a/src/event-parse.c b/src/event-parse.c
index 2b346a5..7a84789 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -1248,7 +1248,7 @@  static enum tep_event_type __read_token(char **tok)
 			if (ch == '\\' && last_ch == '\\')
 				last_ch = 0;
 			/* Break out if the file is corrupted and giving non print chars */
-		} while ((ch != quote_ch && isprint(ch)) || last_ch == '\\');
+		} while ((ch != quote_ch && isprint(ch)) || last_ch == '\\' || ch == '\n');
 		/* remove the last quote */
 		i--;