]> sigrok.org Git - libsigrokdecode.git/commitdiff
srd: always set default options, regardless of overrides
authorBert Vermeulen <redacted>
Wed, 18 Jan 2012 21:59:14 +0000 (22:59 +0100)
committerBert Vermeulen <redacted>
Wed, 18 Jan 2012 21:59:14 +0000 (22:59 +0100)
controller.c

index 6bb7748ef05eee8b9890a665289f867a08833389..4fa729ca81430c100cc809c84ada0e9301a19310 100644 (file)
@@ -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;