]> sigrok.org Git - libsigrok.git/commitdiff
ipdbg-la: scan(): Use g_strdup_printf().
authorUwe Hermann <redacted>
Thu, 30 Aug 2018 00:02:51 +0000 (02:02 +0200)
committerUwe Hermann <redacted>
Thu, 30 Aug 2018 00:02:51 +0000 (02:02 +0200)
src/hardware/ipdbg-la/api.c

index e89c3a2886a2dd68c3b03d5541040b1088f25d81..59f3f56e955d1313f8538605ee3b8955859c8d24 100644 (file)
@@ -113,10 +113,9 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        sr_dbg("limit samples = %" PRIu64 "\n", devc->limit_samples_max);
 
        for (uint32_t i = 0; i < devc->data_width; i++) {
-               const uint8_t buf_size = 16;
-               char buf[buf_size];
-               snprintf(buf, buf_size, "ch%d", i);
-               sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, buf);
+               char *name = g_strdup_printf("CH%d", i);
+               sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, name);
+               g_free(name);
        }
 
        sdi->inst_type = SR_INST_USER;