From: Timo Kokkonen Date: Thu, 10 Oct 2013 18:32:45 +0000 (+0300) Subject: Fill in time stamp even if charger produces zero input X-Git-Url: http://git.itanic.dy.fi/?p=log-plotter;a=commitdiff_plain;h=4513e907ea9701f062653990fa61674ee51d8674 Fill in time stamp even if charger produces zero input Always zero timestamp is invalid. Replace it with a proper one. Signed-off-by: Timo Kokkonen --- diff --git a/data.c b/data.c index 0e334d8..639b6f8 100644 --- a/data.c +++ b/data.c @@ -262,11 +262,12 @@ int read_data(int infd, int outfd) parse_logline(buf, &data); - dump_data(&data); - - if (isnan(data.timestamp)) + /* Fill in possibly missing timestamp */ + if (isnan(data.timestamp) || data.timestamp == 0); data.timestamp = cur_time - start_time; + dump_data(&data); + if (!outfd) continue;