From: Timo Sirainen Date: Fri, 9 Jul 2004 19:12:32 +0000 (+0300) Subject: Crashfix with empty mailbox X-Git-Tag: 1.1.alpha1~3799 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=089756ceca55966f1a70e8591f6086026e51015c;p=thirdparty%2Fdovecot%2Fcore.git Crashfix with empty mailbox --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index a806af3d57..be9d60d405 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -326,7 +326,8 @@ static void mail_cache_update_need_compress(struct mail_cache *cache) 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 */