view->last_ref_index = ref_index;
}
+static void
+mail_index_strmap_zero_terminate(struct mail_index_strmap_view *view)
+{
+ /* zero-terminate the records array */
+ (void)array_append_space(&view->recs);
+ array_delete(&view->recs, array_count(&view->recs)-1, 1);
+}
+
static void mail_index_strmap_view_renumber(struct mail_index_strmap_view *view)
{
struct mail_index_strmap_read_context ctx;
i_assert(renumber_map[0] == 0);
array_delete(&view->recs, dest, i-dest);
array_delete(&view->recs_crc32, dest, i-dest);
+ mail_index_strmap_zero_terminate(view);
/* notify caller of the renumbering */
i_assert(str_idx <= view->next_str_idx);
i_free(sync);
(void)mail_index_strmap_write(view);
+ mail_index_strmap_zero_terminate(view);
/* zero-terminate the records array */
(void)array_append_space(&view->recs);
*_sync = NULL;
mail_index_strmap_view_reset(sync->view);
+ mail_index_strmap_zero_terminate(sync->view);
i_free(sync);
}
MAILBOX_SEARCH_RESULT_FLAG_QUEUE_SYNC);
msgid_map = array_get(tbox->msgid_map, &count);
+ /* we're relying on the array being zero-terminated (outside used
+ count - kind of kludgy) */
+ i_assert(msgid_map[count].uid == 0);
i = 0;
while (i < count && mailbox_search_next(search_ctx, mail) > 0) {
while (msgid_map[i].uid < mail->uid)