dovecot-2.2: lib-stats: fix tristate-int vs. bool return value c...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 15 11:58:38 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/cac29b3a1e96
changeset: 18860:cac29b3a1e96
user:      Phil Carmody <phil at dovecot.fi>
date:      Mon Jun 15 14:55:03 2015 +0300
description:
lib-stats: fix tristate-int vs. bool return value confusion
-1 was being silently converted to true. However, this was an error condition.

The callers don't need anything more complex than a bool, so kill the int.

Signed-off-by: Phil Carmody <phil at dovecot.fi>

diffstat:

 src/lib-stats/stats.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r d2a637585bfa -r cac29b3a1e96 src/lib-stats/stats.c
--- a/src/lib-stats/stats.c	Mon Jun 15 14:55:01 2015 +0300
+++ b/src/lib-stats/stats.c	Mon Jun 15 14:55:03 2015 +0300
@@ -195,12 +195,12 @@
 		p = memchr(data, '\0', size);
 		if (p == NULL) {
 			*error_r = "Expected name, but NUL is missing";
-			return -1;
+			return FALSE;
 		}
 		item = stats_item_find_by_name(next_name);
 		if (item == NULL) {
 			*error_r = t_strdup_printf("Unknown stats name: '%s'", next_name);
-			return -1;
+			return FALSE;
 		}
 		size -= (p+1) - data;
 		data = p+1;


More information about the dovecot-cvs mailing list