From: Timo Kokkonen Date: Sat, 14 Mar 2020 09:31:10 +0000 (+0200) Subject: rrdtool: Fix bug with messed up log printing X-Git-Url: http://git.itanic.dy.fi/?p=rrdd;a=commitdiff_plain;h=e2dabbb0edbebc6e107ed8e8c385fa624ed79a04 rrdtool: Fix bug with messed up log printing Commit 3d128efe07 forgot to take account update data strings no longer start with "N:", but with a unix timestamp and ":". This messed up the logs. Fix it by parsing up to the first colon and stripping the timestamp away. Signed-off-by: Timo Kokkonen --- diff --git a/rrdtool.c b/rrdtool.c index 5b7d3ac..7c0646d 100644 --- a/rrdtool.c +++ b/rrdtool.c @@ -222,7 +222,11 @@ static int write_to_logfile(struct rrd_database *rrd, const char *data) str_ptr = logstr + strlen(logstr); - data += 2; /* Skip the "N: part */ + /* Skip the "N: part */ + while (*data != ':') + data++; + data++; + spacing = 12; while (*data && str_ptr - logstr < sizeof(logstr) - 1) {