Skip to content

Commit

Permalink
parsers: use common library code to rename sigrok channels
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gsigh committed Aug 16, 2022
1 parent e8e8b5e commit 99595de
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions parsers.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ GSList *parse_channelstring(struct sr_dev_inst *sdi, const char *channelstring)
}
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);

Expand Down

0 comments on commit 99595de

Please sign in to comment.