summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2009-06-13 14:58:33 +0000
committerroot <root>2009-06-13 14:58:33 +0000
commit17ae00914756419ccbbc460c94a016d5457989a8 (patch)
treef4d60b2eee4db8f8198890ccf0c3c1de7b065e9d
parent11a7ad48b25e8abb1e9c610f780c3de618e2d224 (diff)
-rw-r--r--eio.c5
1 files changed, 4 insertions, 1 deletions
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;
}