src/objacces.c
changeset 429 7cba38279f98
parent 421 6221b4db8c42
child 430 61a24423589c
equal deleted inserted replaced
428:25b06f59f123 429:7cba38279f98
   167          * */
   167          * */
   168         /* Copy null terminated string to user, and return discovered size */
   168         /* Copy null terminated string to user, and return discovered size */
   169         UNS8 *ptr = (UNS8*)ptrTable->pSubindex[bSubindex].pObject;
   169         UNS8 *ptr = (UNS8*)ptrTable->pSubindex[bSubindex].pObject;
   170         UNS8 *ptr_start = ptr;
   170         UNS8 *ptr_start = ptr;
   171         UNS8 *ptr_end = ptr + *pExpectedSize; /* *pExpectedSize IS < szData */ 
   171         UNS8 *ptr_end = ptr + *pExpectedSize; /* *pExpectedSize IS < szData */ 
       
   172         UNS8 *ptr_dest = (UNS8*)pDestData;
   172         while( *ptr && ptr < ptr_end){
   173         while( *ptr && ptr < ptr_end){
   173             *((UNS8*)pDestData++) = *(ptr++);
   174             *(ptr_dest++) = *(ptr++);
   174         } 
   175         } 
   175          
   176          
   176         *pExpectedSize = ptr - ptr_start;
   177         *pExpectedSize = ptr - ptr_start;
   177         /* terminate string if not maximum length */
   178         /* terminate string if not maximum length */
   178         if (*pExpectedSize < szData) 
   179         if (*pExpectedSize < szData)