aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2022-02-21 15:46:28 -0500
committerSteven Rostedt (Google) <rostedt@goodmis.org>2022-02-21 16:13:54 -0500
commitc642be90d6b699ace94ddf393a395fe0ee9a1ffc (patch)
tree06e44e8d5864d093e67810c3cb91272cda49f0cf
parent69d59c8bf4c732afb537acfc4c324f10d2484704 (diff)
downloadlibtraceevent-c642be90d6b699ace94ddf393a395fe0ee9a1ffc.tar.gz
libtraceevent: Account for events with newlines in print fmt
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. Link: https://lore.kernel.org/linux-trace-devel/20220221154628.525d7513@rorschach.local.home Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--src/event-parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/event-parse.c b/src/event-parse.c
index 11557b1..d00cd5a 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -1264,7 +1264,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--;