[dovecot-cvs] dovecot/src/lib-index mail-cache.c,1.39,1.40

cras at dovecot.org cras at dovecot.org
Fri Jul 9 22:12:34 EEST 2004


Update of /home/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv6274/lib-index

Modified Files:
	mail-cache.c 
Log Message:
Crashfix with empty mailbox



Index: mail-cache.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-cache.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- mail-cache.c	8 Jul 2004 20:26:15 -0000	1.39
+++ mail-cache.c	9 Jul 2004 19:12:32 -0000	1.40
@@ -326,7 +326,8 @@
 	uoff_t max_del_space;
 
         cont_percentage = hdr->continued_record_count * 100 /
-		cache->index->map->records_count;
+		(cache->index->map->records_count == 0 ? 1 :
+		 cache->index->map->records_count);
 	if (cont_percentage >= COMPRESS_CONTINUED_PERCENTAGE &&
 	    hdr->used_file_size >= COMPRESS_MIN_SIZE) {
 		/* too many continued rows, compress */



More information about the dovecot-cvs mailing list