Merged changeset 948:923323444178 from default branch: valgrind sorting fix. stable-1.0
authorRyan C. Gordon <icculus@icculus.org>
Sat, 28 Feb 2009 01:37:57 -0500
branchstable-1.0
changeset 949 8badfbbb3b27
parent 940 a624957f6288
child 951 b3dc1c94a0b5
Merged changeset 948:923323444178 from default branch: valgrind sorting fix.
physfs.c
--- a/physfs.c	Thu Apr 03 05:07:35 2008 +0000
+++ b/physfs.c	Sat Feb 28 01:37:57 2009 -0500
@@ -214,7 +214,8 @@
                 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 */