From 17ae00914756419ccbbc460c94a016d5457989a8 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 13 Jun 2009 14:58:33 +0000 Subject: 3.23 --- eio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eio.c b/eio.c index cfd9d10..a5b7ba2 100644 --- a/eio.c +++ b/eio.c @@ -1070,7 +1070,7 @@ eio_dent_sort (eio_dirent *dents, int size) { int min = 0; - for (i = size > EIO_QSORT_SKIP ? EIO_QSORT_CUTOFF : size; --i; ) + for (i = size > EIO_QSORT_SKIP ? EIO_QSORT_CUTOFF + 1 : size; --i; ) if (EIO_DENT_CMP (dents [i], <, dents [min])) min = i; @@ -1086,7 +1086,10 @@ eio_dent_sort (eio_dirent *dents, int size) eio_dirent value = dents [i]; for (j = i - 1; EIO_DENT_CMP (dents [j], >, value); --j) + { + assert (j >= 0); dents [j + 1] = dents [j]; + } dents [j + 1] = value; } -- cgit v1.2.3