From e431d9cc4afa5e695efea61fb769f20d86f0bbe0 Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Wed, 18 Jan 2012 22:59:14 +0100 Subject: srd: always set default options, regardless of overrides --- controller.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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; -- cgit v1.2.3-70-g09d2