]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 25 Jul 2017 06:43:56 +0000 (09:43 +0300)
src/lib/var-expand-if.c

index 98e03c5528690f528413209aa8c251e7bff94320..47c0cc8a88e11b3acafcc8c8b8779cd21f4a0761 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;
@@ -158,7 +159,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: