diff --git a/src/fmpi_domain.c b/src/fmpi_domain.c index 8608c4be3af9c6b85987a29dffe2e7e149afef3b..a83d4d3622e334a116cd4da49afa488fc2de5ee6 100644 --- a/src/fmpi_domain.c +++ b/src/fmpi_domain.c @@ -136,10 +136,10 @@ static struct fmpi_data fmpi_halo_1d( memcpy(((char *)halo.raw + type_size), data.raw, (data.size + type_size)); // Right boundary } else if(rank == (size_t)(ctx->mpi->size - 1)) { - memcpy(halo.raw, ((const char *)(data.raw) - type_size), size); + memcpy(halo.raw, ((const char *)(data.raw) - type_size), (data.size + type_size)); // Middle } else { - memcpy(halo.raw, ((const char *)(data.raw) - type_size), (data.size + type_size)); + memcpy(halo.raw, ((const char *)(data.raw) - type_size), size); } return halo; }