Mercurial > dovecot > core-2.2
changeset 18860:cac29b3a1e96
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@dovecot.fi>
author | Phil Carmody <phil@dovecot.fi> |
---|---|
date | Mon, 15 Jun 2015 14:55:03 +0300 |
parents | d2a637585bfa |
children | 5450f9217b97 |
files | src/lib-stats/stats.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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;