From: Uwe Hermann Date: Thu, 30 Aug 2018 00:02:51 +0000 (+0200) Subject: ipdbg-la: scan(): Use g_strdup_printf(). X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8bc8e9094c384b914d6dfbb1bb4acd40229e0054;p=libsigrok.git ipdbg-la: scan(): Use g_strdup_printf(). --- diff --git a/src/hardware/ipdbg-la/api.c b/src/hardware/ipdbg-la/api.c index e89c3a28..59f3f56e 100644 --- a/src/hardware/ipdbg-la/api.c +++ b/src/hardware/ipdbg-la/api.c @@ -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;