From 194f764ad2d7eccae8d6ff92b7f9e66a4e5877e9 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Fri, 11 Feb 2005 06:28:52 +0000 Subject: [PATCH] Always update max_data before returning from the pack functions. And the condition to completly fill a buffer is <= not < !!! This commit was SVN r4393. --- src/datatype/dt_pack.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/datatype/dt_pack.c b/src/datatype/dt_pack.c index 5e3bc485b5..1973a33a0d 100644 --- a/src/datatype/dt_pack.c +++ b/src/datatype/dt_pack.c @@ -277,6 +277,7 @@ int ompi_convertor_pack_homogeneous_with_memcpy( ompi_convertor_t* pConv, pConv->bConverted += bConverted; /* update the byte converted field in the convertor */ iov[0].iov_len = bConverted; /* update the length in the iovec */ + *max_data = bConverted; return (pConv->bConverted == (pData->size * pConv->count)); } @@ -443,8 +444,8 @@ int ompi_convertor_pack_no_conversion( ompi_convertor_t* pConv, * we still have enough room in the buffer... */ if( ((savePos + saveLength) == (pConv->pBaseBuf + lastDisp)) - && ((saveLength + last_blength) < space_on_iovec) ) { - /* ok still contiguous */ + && ((saveLength + last_blength) <= space_on_iovec) ) { + /* ok still contiguous and we still have some space on the buffer */ saveLength += last_blength; /* nothing else to do, we act the next time */ } else {