From 15a8885758a5e6b4d7d03d7cacd89a212bbf9847 Mon Sep 17 00:00:00 2001 From: Boris Egorov Date: Thu, 19 Mar 2015 23:42:34 +0600 Subject: Fix typo in logical condition TYPE_SELECTOR equals to 2, so condition (cur_sel->type_mask | TYPE_SELECTOR) will always be true. We should increase c only if we encounter a selector. Issue detected by Cppcheck and MSVS (see https://bugzilla.gnome.org/show_bug.cgi?id=507484) Signed-off-by: Boris Egorov --- src/cr-simple-sel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cr-simple-sel.c b/src/cr-simple-sel.c index 0add0ea..ac90685 100644 --- a/src/cr-simple-sel.c +++ b/src/cr-simple-sel.c @@ -254,7 +254,7 @@ cr_simple_sel_compute_specificity (CRSimpleSel * a_this) g_return_val_if_fail (a_this, CR_BAD_PARAM_ERROR); for (cur_sel = a_this; cur_sel; cur_sel = cur_sel->next) { - if (cur_sel->type_mask | TYPE_SELECTOR) { + if (cur_sel->type_mask & TYPE_SELECTOR) { c++; /*hmmh, is this a new language ? */ } else if (!cur_sel->name || !cur_sel->name->stryng -- cgit v1.2.1