summaryrefslogtreecommitdiff
path: root/decoder.c
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2014-03-11 23:27:31 +0100
committerBert Vermeulen <bert@biot.com>2014-03-11 23:27:31 +0100
commit65f6eb77a33e6e7185376b1d9b8f3f0c62273d27 (patch)
treeb225ba84f41d8a453013faaaa958864509a5536f /decoder.c
parent24a3d8d0b9b1c0d543e408261aa85e31032b90d8 (diff)
downloadlibsigrokdecode-65f6eb77a33e6e7185376b1d9b8f3f0c62273d27.tar.gz
libsigrokdecode-65f6eb77a33e6e7185376b1d9b8f3f0c62273d27.zip
Fix enumeration of option values.
Diffstat (limited to 'decoder.c')
-rw-r--r--decoder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/decoder.c b/decoder.c
index fd76a1c..1e22d0d 100644
--- a/decoder.c
+++ b/decoder.c
@@ -254,7 +254,7 @@ static int get_options(struct srd_decoder *d)
o->values = g_slist_append(o->values, gvar);
} else if (PyLong_Check(py_item)) {
/* Long */
- lval = PyLong_AsLongAndOverflow(py_default, &overflow);
+ lval = PyLong_AsLongAndOverflow(py_item, &overflow);
if (overflow) {
/* Value is < LONG_MIN or > LONG_MAX */
PyErr_Clear();
@@ -265,9 +265,9 @@ static int get_options(struct srd_decoder *d)
gvar = g_variant_new_int64(lval);
g_variant_ref_sink(gvar);
o->values = g_slist_append(o->values, gvar);
- } else if (PyFloat_Check(py_default)) {
+ } else if (PyFloat_Check(py_item)) {
/* Float */
- if ((dval = PyFloat_AsDouble(py_default)) == -1.0) {
+ if ((dval = PyFloat_AsDouble(py_item)) == -1.0) {
PyErr_Clear();
srd_err("Protocol decoder %s option 'default' has "
"invalid default value.", d->name);