output/csv: fix segfault when naming logic channels

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

This fixes parts of bug #844.

Reported-by: Maxim Sloyko <m.sloyko@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
Wolfram Sang 2017-05-11 13:51:07 +02:00 committed by Uwe Hermann
parent 8005151b87
commit 6a235225b3
1 changed files with 1 additions and 1 deletions

View File

@ -382,7 +382,7 @@ static void process_logic(struct context *ctx,
sample = logic->data + i;
idx = ctx->channels[ch].ch->index;
if (ctx->label_do && !ctx->label_names)
ctx->channels[i].label = "logic";
ctx->channels[j].label = "logic";
ctx->logic_samples[i * ctx->num_logic_channels + ch] = sample[idx / 8] & (1 << (idx % 8));
}
ch++;