From: Bert Vermeulen Date: Wed, 22 Jan 2014 01:44:52 +0000 (+0100) Subject: output/csv: Drop extra separator on every line. X-Git-Tag: libsigrok-0.3.0~209 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=54da58ca9b9bde79d1b22e5254d7e396ff024fea;p=libsigrok.git output/csv: Drop extra separator on every line. --- diff --git a/output/csv.c b/output/csv.c index 5ca8c392..cf9144bc 100644 --- a/output/csv.c +++ b/output/csv.c @@ -150,6 +150,10 @@ static int receive(struct sr_output *o, const struct sr_dev_inst *sdi, g_string_append_c(*out, c ? '1' : '0'); g_string_append_c(*out, ctx->separator); } + if (i && j) { + /* Drop last separator. */ + g_string_truncate(*out, (*out)->len - 1); + } g_string_append_printf(*out, "\n"); } break;