From: Josef 'Jeff' Sipek Date: Thu, 17 Nov 2016 20:59:02 +0000 (-0500) Subject: lib-storage: fix index_mail_get_headers return value X-Git-Tag: 2.3.0.rc1~2577 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=990d55ce3fc461eeacce3ef830b1c5dde5c3f150;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: fix index_mail_get_headers return value And make it more obvious that we're not setting the actual return value in index_mail_get_first_header. --- diff --git a/src/lib-storage/index/index-mail-headers.c b/src/lib-storage/index/index-mail-headers.c index e20fa8c4e4..54e34b016e 100644 --- a/src/lib-storage/index/index-mail-headers.c +++ b/src/lib-storage/index/index-mail-headers.c @@ -785,8 +785,10 @@ int index_mail_get_headers(struct mail *_mail, const char *field, for (;; retry = FALSE) { if (index_mail_get_raw_headers(mail, field, value_r) < 0) return -1; - if (!decode_to_utf8 || **value_r == NULL) + if (**value_r == NULL) return 0; + if (!decode_to_utf8) + return 1; T_BEGIN { ret = index_mail_headers_decode(mail, value_r, UINT_MAX);