static bool checkreturn buf_read(pb_istream_t *stream, pb_byte_t *buf, size_t count)
{
+ size_t i;
const pb_byte_t *source = (const pb_byte_t*)stream->state;
stream->state = (pb_byte_t*)stream->state + count;
if (buf != NULL)
{
- while (count--)
- *buf++ = *source++;
+ for (i = 0; i < count; i++)
+ buf[i] = source[i];
}
return true;
return func(stream, iter->pos, iter->pData);
case PB_HTYPE_OPTIONAL:
- *(bool*)iter->pSize = true;
+ if (iter->pSize != iter->pData)
+ *(bool*)iter->pSize = true;
return func(stream, iter->pos, iter->pData);
case PB_HTYPE_REPEATED: