]> sigrok.org Git - libsigrok.git/commitdiff
output/csv: Drop extra separator on every line.
authorBert Vermeulen <redacted>
Wed, 22 Jan 2014 01:44:52 +0000 (02:44 +0100)
committerBert Vermeulen <redacted>
Wed, 22 Jan 2014 01:44:52 +0000 (02:44 +0100)
output/csv.c

index 5ca8c392d3afcb8300a5576294f2d08913548595..cf9144bc0ba5bbd29639a4a5c4021c235e142735 100644 (file)
@@ -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;