From: Hui Zhu Date: Tue, 11 Sep 2012 13:28:59 +0000 (-0400) Subject: Fix babeltrace-log get big line when the input file last line don't have enter X-Git-Tag: v1.0.0-rc6~24 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=c5e6c71bad2546b4207e1aede426058062010894;ds=sidebyside 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 --- 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); }