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

Reported-by: Maxim Sloyko <m.slo...@gmail.com>
Signed-off-by: Wolfram Sang <w...@the-dreams.de>
---
 src/output/csv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/output/csv.c b/src/output/csv.c
index c39c29a7..8d1bcd98 100644
--- a/src/output/csv.c
+++ b/src/output/csv.c
@@ -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++;
-- 
2.11.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to