From d2fa7208096d19a35efa7cad5988099a5914d33a Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan@rename-it.nl>
Date: Sun, 21 Aug 2016 11:27:37 +0200
Subject: [PATCH] lib-sieve: regex extension: Fixed invalid use of
 sieve_ast_stringlist_map().

Mixed up bool and int return types.
Found with clang -Wstrict-bool.
---
 src/lib-sieve/plugins/regex/mcht-regex.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/lib-sieve/plugins/regex/mcht-regex.c b/src/lib-sieve/plugins/regex/mcht-regex.c
index cc8c37acb..c14f29348 100644
--- a/src/lib-sieve/plugins/regex/mcht-regex.c
+++ b/src/lib-sieve/plugins/regex/mcht-regex.c
@@ -100,11 +100,11 @@ static int mcht_regex_validate_regexp
 			str_sanitize(regex_str, 128), _regexp_error(&regexp, ret));
 
 		regfree(&regexp);
-		return FALSE;
+		return -1;
 	}
 
 	regfree(&regexp);
-	return TRUE;
+	return 1;
 }
 
 struct _regex_key_context {
@@ -126,7 +126,7 @@ static int mcht_regex_validate_key_argument
 			(keyctx->valdtr, keyctx->mtctx, key, keyctx->cflags);
 	}
 
-	return TRUE;
+	return 1;
 }
 
 static bool mcht_regex_validate_context
@@ -158,8 +158,8 @@ static bool mcht_regex_validate_context
 	keyctx.cflags = cflags;
 
 	kitem = key_arg;
-	if ( !sieve_ast_stringlist_map(&kitem, (void *) &keyctx,
-		mcht_regex_validate_key_argument) )
+	if ( sieve_ast_stringlist_map(&kitem, (void *) &keyctx,
+		mcht_regex_validate_key_argument) <= 0 )
 		return FALSE;
 
 	return TRUE;
-- 
GitLab