From: Bert Vermeulen Date: Thu, 26 Jun 2014 17:56:02 +0000 (+0200) Subject: runtc: PD option value is a GVariant, not string. X-Git-Tag: libsigrokdecode-0.4.0~219 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5f22c187f99ea13e0a1a5c8c995e73a75f93a9b1;p=libsigrokdecode.git runtc: PD option value is a GVariant, not string. This is still broken: it needs to properly check the expected type of the option, not just blindly assume G_VARIANT_TYPE_STRING. --- diff --git a/tests/runtc.c b/tests/runtc.c index e376070..ab55139 100644 --- a/tests/runtc.c +++ b/tests/runtc.c @@ -48,7 +48,7 @@ struct channel { struct option { char *key; - char *value; + GVariant *value; }; struct pd { @@ -736,7 +736,8 @@ int main(int argc, char **argv) } else { option = malloc(sizeof(struct option)); option->key = g_strdup(kv[0]); - option->value = g_strdup(kv[1]); + option->value = g_variant_new_string(kv[1]); + g_variant_ref_sink(option->value); /* Apply to last PD. */ pd->options = g_slist_append(pd->options, option); }