index->header->used_file_size -= sizeof(*rec) * count;
index->mmap_used_length -= sizeof(*rec) * count;
+ /* not really needed since append() will initialize it as well,
+ but may help preventing problems if change is only partially
+ written to disk */
+ memset((char *) rec + index->mmap_used_length, 0, sizeof(*rec) * count);
+
return mail_index_truncate(index);
}
index->mmap_used_length);
rec->uid = index->header->next_uid++;
rec->msg_flags = 0;
+ rec->cache_offset = 0;
index->header->used_file_size += sizeof(*rec);
index->mmap_used_length += sizeof(*rec);