ipdbg-la: scan(): Use g_strdup_printf().
This commit is contained in:
parent
4d33f5e112
commit
8bc8e9094c
|
@ -113,10 +113,9 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
|
||||||
sr_dbg("limit samples = %" PRIu64 "\n", devc->limit_samples_max);
|
sr_dbg("limit samples = %" PRIu64 "\n", devc->limit_samples_max);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < devc->data_width; i++) {
|
for (uint32_t i = 0; i < devc->data_width; i++) {
|
||||||
const uint8_t buf_size = 16;
|
char *name = g_strdup_printf("CH%d", i);
|
||||||
char buf[buf_size];
|
sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, name);
|
||||||
snprintf(buf, buf_size, "ch%d", i);
|
g_free(name);
|
||||||
sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sdi->inst_type = SR_INST_USER;
|
sdi->inst_type = SR_INST_USER;
|
||||||
|
|
Loading…
Reference in New Issue