]> sigrok.org Git - libsigrok.git/commitdiff
rdtech-tc: Fix feed creation loop condition
authorMathieu Pilato <redacted>
Fri, 31 Mar 2023 10:16:24 +0000 (12:16 +0200)
committerGerhard Sittig <redacted>
Fri, 31 Mar 2023 19:11:08 +0000 (21:11 +0200)
[ gsi: Amends commit b3df76683179. ]

src/hardware/rdtech-tc/api.c

index 3b5f1c71e2dac4e8f1d497ff8aacebd9cb755044..ae86fccf5c4bb74bbeba8881afa2ea41b2a9d87b 100644 (file)
@@ -81,7 +81,7 @@ static GSList *rdtech_tc_scan(struct sr_dev_driver *di,
        sdi->conn = serial;
 
        devc->feeds = g_malloc0(devc->channel_count * sizeof(devc->feeds[0]));
-       for (i = 0; devc->channels[i].name; i++) {
+       for (i = 0; i < devc->channel_count; i++) {
                pch = &devc->channels[i];
                ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, pch->name);
                feed = feed_queue_analog_alloc(sdi, 1, pch->digits, ch);