# HG changeset patch # User etisserant # Date 1206091662 -3600 # Node ID 166037b8f2ed42443619413bc9f9f4e397c9f8db # Parent 61a24423589c8072e15d957bfd24bb873a4df474 Fixed typo in objacces.c bigendian side. diff -r 61a24423589c -r 166037b8f2ed src/objacces.c --- a/src/objacces.c Fri Mar 21 09:51:21 2008 +0100 +++ b/src/objacces.c Fri Mar 21 10:27:42 2008 +0100 @@ -144,7 +144,7 @@ # ifdef CANOPEN_BIG_ENDIAN if(endianize && *pDataType > boolean && !( *pDataType >= visible_string && - domain <= *pDataType)) { + *pDataType <= domain)) { /* data must be transmited with low byte first */ UNS8 i, j = 0; MSG_WAR(boolean, "data type ", *pDataType); @@ -154,6 +154,7 @@ ((UNS8*)pDestData)[j++] = ((UNS8*)ptrTable->pSubindex[bSubindex].pObject)[i-1]; } + *pExpectedSize = szData; } else /* no endianisation change */ # endif @@ -168,7 +169,8 @@ /* Copy null terminated string to user, and return discovered size */ UNS8 *ptr = (UNS8*)ptrTable->pSubindex[bSubindex].pObject; UNS8 *ptr_start = ptr; - UNS8 *ptr_end = ptr + *pExpectedSize; /* *pExpectedSize IS < szData */ + /* *pExpectedSize IS < szData . if null, use szData */ + UNS8 *ptr_end = ptr + (*pExpectedSize ? *pExpectedSize : szData) ; UNS8 *ptr_dest = (UNS8*)pDestData; while( *ptr && ptr < ptr_end){ *(ptr_dest++) = *(ptr++); @@ -307,7 +309,7 @@ /* re-endianize do not occur for bool, strings time and domains */ if(endianize && dataType > boolean && !( dataType >= visible_string && - domain <= dataType)) + dataType <= domain)) { /* we invert the data source directly. This let us do range testing without */