changeset 2307:75d7f8049add HEAD

Crashfix with empty mailbox
author Timo Sirainen <tss@iki.fi>
date Fri, 09 Jul 2004 22:12:32 +0300
parents 6aa77fdf152e
children 5f34cfdc29e6
files src/lib-index/mail-cache.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache.c	Fri Jul 09 22:09:17 2004 +0300
+++ b/src/lib-index/mail-cache.c	Fri Jul 09 22:12:32 2004 +0300
@@ -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 */