From 42eb0768d5f1694badf4fa1ea2db6c0c43548c85 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 28 Feb 2009 01:37:57 -0500 Subject: [PATCH] Merged changeset 948:923323444178 from default branch: valgrind sorting fix. --- physfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/physfs.c b/physfs.c index 40f85bef..fcc82f6b 100644 --- a/physfs.c +++ b/physfs.c @@ -214,7 +214,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 */