diff --git a/ompi/mpi/c/pack.c b/ompi/mpi/c/pack.c index ab00e08688..d841e058ca 100644 --- a/ompi/mpi/c/pack.c +++ b/ompi/mpi/c/pack.c @@ -73,7 +73,7 @@ int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype, /* Prepare the iovec with all informations */ invec.iov_base = (char*) outbuf + (*position); - invec.iov_len = outsize - (*position); + invec.iov_len = size; /* Do the actual packing */ iov_count = 1; diff --git a/ompi/mpi/c/pack_external.c b/ompi/mpi/c/pack_external.c index 7d99290a1d..1af7412d4f 100644 --- a/ompi/mpi/c/pack_external.c +++ b/ompi/mpi/c/pack_external.c @@ -71,7 +71,7 @@ int MPI_Pack_external(char *datarep, void *inbuf, int incount, /* Prepare the iovec with all informations */ invec.iov_base = (char*) outbuf + (*position); - invec.iov_len = outsize - (*position); + invec.iov_len = size; /* Do the actual packing */ iov_count = 1; diff --git a/ompi/mpi/c/unpack.c b/ompi/mpi/c/unpack.c index 63115ab907..4e8b93879c 100644 --- a/ompi/mpi/c/unpack.c +++ b/ompi/mpi/c/unpack.c @@ -77,7 +77,7 @@ int MPI_Unpack(void *inbuf, int insize, int *position, /* Prepare the iovec with all informations */ outvec.iov_base = (char*) inbuf + (*position); - outvec.iov_len = insize - (*position); + outvec.iov_len = size; /* Do the actual unpacking */ iov_count = 1; diff --git a/ompi/mpi/c/unpack_external.c b/ompi/mpi/c/unpack_external.c index 41d56729b3..2a1679aa84 100644 --- a/ompi/mpi/c/unpack_external.c +++ b/ompi/mpi/c/unpack_external.c @@ -68,7 +68,7 @@ int MPI_Unpack_external (char *datarep, void *inbuf, MPI_Aint insize, /* Prepare the iovec with all informations */ outvec.iov_base = (char*) inbuf + (*position); - outvec.iov_len = insize - (*position); + outvec.iov_len = size; /* Do the actual unpacking */ iov_count = 1;