X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=sigrok-cli.c;h=1bf6c7d801d40770f99f1d075ed0d251925abf5e;hp=ae6a63771333467098d683096bbda556d99391f3;hb=67ce0d2757835e1c23967277631dac87a61a3f82;hpb=9720f23aba9333a5bbbc6f7bb10cd07ff8734de6 diff --git a/sigrok-cli.c b/sigrok-cli.c index ae6a637..1bf6c7d 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -495,14 +495,16 @@ static int register_pds(struct sr_device *device, const char *pdstring) goto err_out; } g_datalist_set_data(&pd_ann_visible, di->instance_id, pd_name); - } - /* Any keys left in the options hash are probes, where the key - * is the probe name as specified in the decoder class, and the - * value is the probe number i.e. the order in which the PD's - * incoming samples are arranged. */ - if (srd_instance_set_probes(di, pd_opthash) != SRD_OK) - return 1; + /* Any keys left in the options hash are probes, where the key + * is the probe name as specified in the decoder class, and the + * value is the probe number i.e. the order in which the PD's + * incoming samples are arranged. */ + if (srd_instance_set_probes(di, pd_opthash) != SRD_OK) + goto err_out; + g_hash_table_destroy(pd_opthash); + pd_opthash = NULL; + } err_out: g_strfreev(pdtokens); @@ -1027,12 +1029,12 @@ int main(int argc, char **argv) return 1; } - if (!(di_from = srd_instance_find(pds[0]))) { + if (!(di_from = srd_instance_find_by_id(pds[0]))) { printf("Cannot stack protocol decoder '%s': instance not found.\n", pds[0]); return 1; } for (i = 1; pds[i]; i++) { - if (!(di_to = srd_instance_find(pds[i]))) { + if (!(di_to = srd_instance_find_by_id(pds[i]))) { printf("Cannot stack protocol decoder '%s': instance not found.\n", pds[i]); return 1; }