changeset 7201:52639b885d87 HEAD

Infinite looping fix.
author Timo Sirainen <tss@iki.fi>
date Wed, 30 Jan 2008 18:41:37 +0200
parents c7f1cb8556be
children ace71babd1ec
files src/lib-storage/index/index-sort.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-sort.c	Wed Jan 30 18:41:23 2008 +0200
+++ b/src/lib-storage/index/index-sort.c	Wed Jan 30 18:41:37 2008 +0200
@@ -356,7 +356,8 @@
 		   widening the area we're giving sort IDs. */
 		if (left_idx > 0) {
 			left_idx--;
-			left_sort_id = nodes[left_idx].sort_id;
+			left_sort_id = left_idx == 0 ? 1 :
+				nodes[left_idx].sort_id;
 			i_assert(left_sort_id != 0);
 		}