Valgrind fix: avoid overlapping memcpy() in sorting routines (thanks, JLM!).

This commit is contained in:
Ryan C. Gordon 2009-02-28 01:34:02 -05:00
parent 43dbf3a22c
commit 78037a7ccb
1 changed files with 2 additions and 1 deletions

View File

@ -245,7 +245,8 @@ static void __PHYSFS_quick_sort(void *a, PHYSFS_uint32 lo, PHYSFS_uint32 hi,
break;
swapfn(a, i, j);
} /* while */
swapfn(a, i, hi-1);
if (i != (hi-1))
swapfn(a, i, hi-1);
__PHYSFS_quick_sort(a, lo, j, cmpfn, swapfn);
__PHYSFS_quick_sort(a, i+1, hi, cmpfn, swapfn);
} /* else */