From: Gerhard Sittig Date: Tue, 16 Aug 2022 20:14:23 +0000 (+0200) Subject: parsers: use common library code to rename sigrok channels X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=99595de1452934951c0d8311cf5dceef897f9860;p=sigrok-cli.git parsers: use common library code to rename sigrok channels Drop an open coded g_free() and g_strdup() sequence which accesses internal details of a sigrok channel. Use the sr_dev_channel_name_set() library routine instead. --- diff --git a/parsers.c b/parsers.c index c1ab9bd..b74d74f 100644 --- a/parsers.c +++ b/parsers.c @@ -139,8 +139,7 @@ range_fail: } if (names[1]) { /* Rename channel. */ - g_free(ch->name); - ch->name = g_strdup(names[1]); + sr_dev_channel_name_set(ch, names[1]); } channellist = g_slist_append(channellist, ch);