From: Bert Vermeulen Date: Wed, 18 Jan 2012 21:59:14 +0000 (+0100) Subject: srd: always set default options, regardless of overrides X-Git-Tag: libsigrokdecode-0.1.0~125 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e431d9cc4afa5e695efea61fb769f20d86f0bbe0;p=libsigrokdecode.git srd: always set default options, regardless of overrides --- diff --git a/controller.c b/controller.c index 6bb7748..4fa729c 100644 --- a/controller.c +++ b/controller.c @@ -146,13 +146,17 @@ int srd_instance_set_options(struct srd_decoder_instance *di, int num_optkeys, ret, size, i; char *key, *value; - if (g_hash_table_size(options) == 0) - /* No options provided. */ - return SRD_OK; - - if(!PyObject_HasAttrString(di->decoder->py_dec, "options")) + if(!PyObject_HasAttrString(di->decoder->py_dec, "options")) { /* Decoder has no options. */ + if (g_hash_table_size(options) == 0) { + /* No options provided. */ + return SRD_OK; + } else { + srd_err("Protocol decoder has no options."); + return SRD_ERR_ARG; + } return SRD_OK; + } ret = SRD_ERR_PYTHON; key = NULL;