dovecot-2.0: lib-index: Make static analyzer happier.

dovecot at dovecot.org dovecot at dovecot.org
Fri Dec 3 12:47:50 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/0e72f1629096
changeset: 12509:0e72f1629096
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Dec 03 10:47:46 2010 +0000
description:
lib-index: Make static analyzer happier.

diffstat:

 src/lib-index/mail-index-sync-keywords.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r 383b3acff1ee -r 0e72f1629096 src/lib-index/mail-index-sync-keywords.c
--- a/src/lib-index/mail-index-sync-keywords.c	Fri Dec 03 10:47:07 2010 +0000
+++ b/src/lib-index/mail-index-sync-keywords.c	Fri Dec 03 10:47:46 2010 +0000
@@ -141,14 +141,16 @@
 
 	if (buf == NULL) {
 		/* create new / replace broken header */
+		const unsigned int initial_keywords_count = 1;
+
 		buf = buffer_create_dynamic(pool_datastack_create(), 512);
 		kw_hdr = buffer_append_space_unsafe(buf, sizeof(*kw_hdr));
-		kw_hdr->keywords_count = 1;
+		kw_hdr->keywords_count = initial_keywords_count;
 
                 keywords_count = kw_hdr->keywords_count;
 		rec_offset = buf->used;
 		name_offset_root = rec_offset +
-			kw_hdr->keywords_count * sizeof(kw_rec);
+			initial_keywords_count * sizeof(kw_rec);
 		name_offset = 0;
 	}
 


More information about the dovecot-cvs mailing list