From: Timo Kokkonen Date: Mon, 7 Oct 2013 18:08:56 +0000 (+0300) Subject: Discard too short log lines X-Git-Url: http://git.itanic.dy.fi/?p=log-plotter;a=commitdiff_plain;h=5b5bb6500af4523d153306590d24032552cc17ed Discard too short log lines Some times the serial output contains incorrect entries, typically in the beginning of log acquicition. Discard them so that they don't clutter the log output. Signed-off-by: Timo Kokkonen --- diff --git a/main.c b/main.c index 776f81e..8e14521 100644 --- a/main.c +++ b/main.c @@ -110,6 +110,12 @@ static int read_data(int infd, int outfd) if (ret == 0) continue; + if (strlen(buf) < 5) { + pr_debug("discarding truncated log entry\n"); + offset = 0; + continue; + } + cur_time = time(NULL); pr_info("%s\n", buf);