static int init(struct sr_output *o)
{
struct context *ctx;
- struct sr_probe *probe;
+ struct sr_channel *probe;
GSList *l;
GVariant *gvar;
int num_probes;
ctx->samplerate);
/* Columns / channels */
- g_string_append_printf(ctx->header, "; Channels (%d/%d): ",
+ g_string_append_printf(ctx->header, "; Channels (%d/%d):",
ctx->num_enabled_probes, num_probes);
for (l = o->sdi->probes; l; l = l->next) {
probe = l->data;
continue;
if (!probe->enabled)
continue;
- g_string_append_printf(ctx->header, "%s, ", probe->name);
+ g_string_append_printf(ctx->header, " %s,", probe->name);
}
+ if (o->sdi->probes)
+ /* Drop last separator. */
+ g_string_truncate(ctx->header, ctx->header->len - 1);
g_string_append_printf(ctx->header, "\n");
return SR_OK;
g_string_append_c(*out, c ? '1' : '0');
g_string_append_c(*out, ctx->separator);
}
+ if (j) {
+ /* Drop last separator. */
+ g_string_truncate(*out, (*out)->len - 1);
+ }
g_string_append_printf(*out, "\n");
}
break;