From: Bert Vermeulen Date: Thu, 9 Oct 2014 21:42:24 +0000 (+0200) Subject: Fix sr_dev_has_option(). X-Git-Tag: libsigrok-0.4.0~879 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=d099d8802111c775465de18cb69c746c342d9ac1 Fix sr_dev_has_option(). This wasn't taking the SR_CONF_GET/_SET/_LIST flags into account. Thanks to Janne Huttunen for spotting this. --- diff --git a/src/device.c b/src/device.c index 7bfaa4cf..9ed60802 100644 --- a/src/device.c +++ b/src/device.c @@ -191,7 +191,7 @@ SR_API gboolean sr_dev_has_option(const struct sr_dev_inst *sdi, int key) ret = FALSE; devopts = g_variant_get_fixed_array(gvar, &num_opts, sizeof(int32_t)); for (i = 0; i < num_opts; i++) { - if (devopts[i] == key) { + if ((devopts[i] & SR_CONF_MASK) == key) { ret = TRUE; break; }