]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Crashfix with empty mailbox
authorTimo Sirainen <tss@iki.fi>
Fri, 9 Jul 2004 19:12:32 +0000 (22:12 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 9 Jul 2004 19:12:32 +0000 (22:12 +0300)
--HG--
branch : HEAD

src/lib-index/mail-cache.c

index a806af3d5765d1d0aef7a39dca4873c22bbc503b..be9d60d405b4f6922886546158a66b7aa532b8eb 100644 (file)
@@ -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 */