From c5e6c71bad2546b4207e1aede426058062010894 Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Tue, 11 Sep 2012 09:28:59 -0400 Subject: [PATCH] Fix babeltrace-log get big line when the input file last line don't have enter I got: [Error] Line too large for packet size (32kB) (discarded) When I input a file to babeltrace-log. That is because the last line of the input file doesn't have enter and "babeltrace-log" have bug with the line that doesn't have enter. Signed-off-by: Mathieu Desnoyers --- converter/babeltrace-log.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c index 7f31d015..f7eb5f76 100644 --- a/converter/babeltrace-log.c +++ b/converter/babeltrace-log.c @@ -240,9 +240,12 @@ void trace_text(FILE *input, int output) if (len < 0) break; nl = strrchr(line, '\n'); - if (nl) + if (nl) { *nl = '\0'; - trace_string(line, &pos, nl - line + 1); + trace_string(line, &pos, nl - line + 1); + } else { + trace_string(line, &pos, strlen(line) + 1); + } } ctf_fini_pos(&pos); } -- 2.34.1