[lttng-dev] [PATCH/babeltrace] Fix babeltrace-log get big line when the input file last line don't have enter
Hui Zhu
teawater at gmail.com
Tue Sep 11 03:19:09 EDT 2012
Hi,
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.
So I post a patch for it.
Thanks,
Hui
--- a/converter/babeltrace-log.c
+++ b/converter/babeltrace-log.c
@@ -240,9 +240,11 @@ 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);
}
More information about the lttng-dev
mailing list