output/csv: get proper index for input channels

'j' is the loop variable for channels, not 'ch'.

This fixes parts of bug #844.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
Wolfram Sang 2017-05-11 13:51:10 +02:00 committed by Uwe Hermann
parent 7e7d7bc074
commit 10892c5b8a
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ static void process_logic(struct context *ctx,
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));