1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

csv: only print offset if both received and origin timestamps are available

This commit is contained in:
Steffen Vogel 2019-04-17 18:13:47 +02:00
parent 39afa0e8a2
commit 65828daed4

View file

@ -44,7 +44,7 @@ static size_t csv_sprint_single(struct io *io, char *buf, size_t len, const stru
}
if (io->flags & SAMPLE_HAS_OFFSET) {
if (smp->flags & SAMPLE_HAS_TS_RECEIVED)
if ((smp->flags & SAMPLE_HAS_TS_RECEIVED) && (smp->flags & SAMPLE_HAS_TS_RECEIVED))
off += snprintf(buf + off, len - off, "%c%.09f", io->separator, time_delta(&smp->ts.origin, &smp->ts.received));
else
off += snprintf(buf + off, len - off, "%cnan", io->separator);