projects
/
libsigrokdecode.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
639c568
)
accept only supported types in decoder class default option values
author
Bert Vermeulen
<bert@biot.com>
Wed, 18 Jan 2012 23:00:02 +0000
(
00:00
+0100)
committer
Bert Vermeulen
<bert@biot.com>
Thu, 19 Jan 2012 14:07:40 +0000
(15:07 +0100)
controller.c
patch
|
blob
|
history
diff --git
a/controller.c
b/controller.c
index f5e272edea49b8c1d5b17bee1502456ec7f9e61a..ebda088932ea4885f5b834c81e0b914773ee137e 100644
(file)
--- a/
controller.c
+++ b/
controller.c
@@
-204,6
+204,10
@@
int srd_instance_set_options(struct srd_decoder_instance *di,
goto err_out;
if (!(py_classval = PyList_GetItem(py_optlist, 1)))
goto err_out;
+ if (!PyUnicode_Check(py_classval) && !PyLong_Check(py_classval)) {
+ srd_err("Options of type %s are not yet supported.", Py_TYPE(py_classval)->tp_name);
+ goto err_out;
+ }
if ((value = g_hash_table_lookup(options, key))) {
/* An override for this option was provided. */