From 65f6eb77a33e6e7185376b1d9b8f3f0c62273d27 Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Tue, 11 Mar 2014 23:27:31 +0100 Subject: Fix enumeration of option values. --- decoder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'decoder.c') 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); -- cgit v1.2.3-70-g09d2