g_string_append_printf(header, "%s Channels (%d/%d):",
ctx->comment, ctx->num_analog_channels +
ctx->num_logic_channels, num_channels);
- for (i = 0, l = o->sdi->channels; l; l = l->next, i++) {
+ for (l = o->sdi->channels; l; l = l->next) {
ch = l->data;
if (ch->enabled)
g_string_append_printf(header, " %s,", ch->name);
if (ctx->channels[j].ch->type == SR_CHANNEL_LOGIC) {
for (i = 0; i < num_samples; i++) {
sample = logic->data + i * logic->unitsize;
- idx = ctx->channels[ch].ch->index;
+ idx = ctx->channels[j].ch->index;
if (ctx->label_do && !ctx->label_names)
ctx->channels[j].label = "logic";
ctx->logic_samples[i * ctx->num_logic_channels + ch] = sample[idx / 8] & (1 << (idx % 8));