about summary refs log tree commit diff
path: root/stdlib/msort.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/msort.c')
-rw-r--r--stdlib/msort.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/stdlib/msort.c b/stdlib/msort.c
index 4cd3e3f167..1c36a4cb9c 100644
--- a/stdlib/msort.c
+++ b/stdlib/msort.c
@@ -71,17 +71,16 @@ msort_with_tmp (b, n, s, cmp, t)
       {
 	if ((*cmp) (b1, b2) <= 0)
 	  {
-	    memcpy (tmp, b1, s);
+	    tmp = (char *) __mempcpy (tmp, b1, s);
 	    b1 += s;
 	    --n1;
 	  }
 	else
 	  {
-	    memcpy (tmp, b2, s);
+	    tmp = (char *) __mempcpy (tmp, b2, s);
 	    b2 += s;
 	    --n2;
 	  }
-	tmp += s;
       }
   if (n1 > 0)
     memcpy (tmp, b1, n1 * s);