]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Fix static analyzer warnings in var-expand-if
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 25 Jul 2017 06:43:56 +0000 (09:43 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 27 Sep 2017 11:36:51 +0000 (14:36 +0300)
src/lib/var-expand-if.c

index 2181421b031466c11d2eecbb19cb55a779ec8c00..c89b36003ea3f6c555e4646c04541ca7d972a875 100644 (file)
@@ -133,6 +133,7 @@ static int var_expand_if_comp(const char *lhs, const char *_op, const char *rhs,
                return 0;
        case OP_STR_NOT_REGEXP:
                neg = TRUE;
+               /* fall through */
        case OP_STR_REGEXP: {
                int ec;
                bool res;
@@ -157,7 +158,7 @@ static int var_expand_if_comp(const char *lhs, const char *_op, const char *rhs,
                   if NOT_REGEXP, neg == TRUE and res should be FALSE
                   if REGEXP, ned == FALSE, and res should be TRUE
                 */
-               *result_r = !res == neg;
+               *result_r = res != neg;
                return 0;
        }
        default: