From 7cacb924c56fc74d686b243f3a36c4fba70be6f0 Mon Sep 17 00:00:00 2001
From: "Peter W. Draper" <p.w.draper@durham.ac.uk>
Date: Tue, 26 Apr 2016 08:33:19 +0100
Subject: [PATCH] Correct memcpy to use sizeof(int), not sizeof(type)

---
 src/space.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/space.c b/src/space.c
index 4a01b3b7a7..93af4222b7 100644
--- a/src/space.c
+++ b/src/space.c
@@ -489,7 +489,7 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
     int *ind_new;
     if ((ind_new = (int *)malloc(sizeof(int) * s->nr_parts)) == NULL)
       error("Failed to allocate temporary particle indices.");
-    memcpy(ind_new, ind, sizeof(size_t) * nr_parts);
+    memcpy(ind_new, ind, sizeof(int) * nr_parts);
     free(ind);
     ind = ind_new;
   }
-- 
GitLab