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: fix detection of column separators

This commit is contained in:
Steffen Vogel 2018-06-16 20:55:42 +02:00
parent 84b18e23bf
commit 4433b3c36c

View file

@ -77,13 +77,13 @@ static size_t csv_sscan_single(struct io *io, const char *buf, size_t len, struc
if (end == ptr || *end == io->delimiter)
goto out;
ptr = end;
ptr = end + 1;
s->ts.origin.tv_nsec = strtoul(ptr, &end, 10);
if (end == ptr || *end == io->delimiter)
goto out;
ptr = end;
ptr = end + 1;
s->flags |= SAMPLE_HAS_ORIGIN;
@ -91,7 +91,7 @@ static size_t csv_sscan_single(struct io *io, const char *buf, size_t len, struc
if (end == ptr || *end == io->delimiter)
goto out;
ptr = end;
ptr = end + 1;
s->sequence = strtoul(ptr, &end, 10);
if (end == ptr || *end == io->delimiter)
@ -99,9 +99,10 @@ static size_t csv_sscan_single(struct io *io, const char *buf, size_t len, struc
s->flags |= SAMPLE_HAS_SEQUENCE;
for (ptr = end, s->length = 0;
s->length < s->capacity;
ptr = end, s->length++) {
for (ptr = end + 1, s->length = 0;
s->length < s->capacity;
ptr = end + 1, s->length++) {
if (*end == io->delimiter)
goto out;