X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=strutil.c;h=5b14f51afc74741d767e5f3ebdf863d8da44daf4;hb=722db131a45dbc84aaa27cf65467a11552a32548;hp=ad9f64974fe8c477df34f9749700ad1f11bddd1e;hpb=d5a669a9e0319531595a8a45b6c21f0c316a24f1;p=libsigrok.git diff --git a/strutil.c b/strutil.c index ad9f6497..5b14f51a 100644 --- a/strutil.c +++ b/strutil.c @@ -216,6 +216,7 @@ SR_API char **sr_parse_triggerstring(const struct sr_dev_inst *sdi, const char *triggerstring) { GSList *l; + GVariant *gvar; struct sr_probe *probe; int max_probes, probenum, i; char **tokens, **triggerlist, *trigger, *tc; @@ -230,11 +231,11 @@ SR_API char **sr_parse_triggerstring(const struct sr_dev_inst *sdi, return NULL; } - if (sdi->driver->config_list(SR_CONF_TRIGGER_TYPE, - (const void **)&trigger_types, sdi) != SR_OK) { + if (sdi->driver->config_list(SR_CONF_TRIGGER_TYPE, &gvar, sdi) != SR_OK) { sr_err("%s: Device doesn't support any triggers.", __func__); return NULL; } + trigger_types = g_variant_get_string(gvar, NULL); tokens = g_strsplit(triggerstring, ",", max_probes); for (i = 0; tokens[i]; i++) { @@ -269,6 +270,7 @@ SR_API char **sr_parse_triggerstring(const struct sr_dev_inst *sdi, } } g_strfreev(tokens); + g_variant_unref(gvar); if (error) { for (i = 0; i < max_probes; i++)