]> sigrok.org Git - libsigrok.git/commitdiff
Fix sr_dev_has_option().
authorBert Vermeulen <redacted>
Thu, 9 Oct 2014 21:42:24 +0000 (23:42 +0200)
committerBert Vermeulen <redacted>
Thu, 9 Oct 2014 21:42:24 +0000 (23:42 +0200)
This wasn't taking the SR_CONF_GET/_SET/_LIST flags into account.

Thanks to Janne Huttunen for spotting this.

src/device.c

index 7bfaa4cfb93e572c04f25010d75e174679d8f44a..9ed6080294096fabc7751903a096f7d1ae1457b3 100644 (file)
@@ -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;
                }