changeset 7231:0706d404a8fb HEAD

Handle first_recent_uid=0 without crashing, even though it shouldn't happen..
author Timo Sirainen <tss@iki.fi>
date Mon, 11 Feb 2008 23:52:09 +0200
parents 777131d76168
children df570f504edf 74e1dc23e441
files src/lib-storage/index/maildir/maildir-sync-index.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-sync-index.c	Mon Feb 11 21:41:41 2008 +0200
+++ b/src/lib-storage/index/maildir/maildir-sync-index.c	Mon Feb 11 23:52:09 2008 +0200
@@ -298,7 +298,7 @@
 	hdr_next_uid = hdr->next_uid;
 
 	mbox->syncing_commit = TRUE;
-	seq = prev_uid = 0; first_recent_uid = hdr->first_recent_uid;
+	seq = prev_uid = 0; first_recent_uid = I_MAX(hdr->first_recent_uid, 1);
 	t_array_init(&ctx->keywords, MAILDIR_MAX_KEYWORDS);
 	t_array_init(&idx_keywords, MAILDIR_MAX_KEYWORDS);
 	iter = maildir_uidlist_iter_init(mbox->uidlist);