libtraceevent: Account for events with newlines in print fmt
PATCH 1/1 libtraceevent: Account for events with newlines in print fmt
From: "Steven Rostedt (Google)" <[email protected]>
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) <[email protected]>
--- src/event-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/event-parse.c +1 -1
@@ -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--;
Signature · 1 line
2.34.1