{
if ((buffer->offset == buffer->count) && (buffer->offset > 0))
{
- if (buffer->count != (ssize_t) sizeof(buffer->data))
+ if (buffer->count != (ssize_t) sizeof(buffer->data)-1)
return(EOF);
buffer->offset=0;
buffer->count=0;
}
if ((buffer->offset == 0) && (buffer->count == 0))
{
- buffer->count=ReadBlob(buffer->image,sizeof(buffer->data),buffer->data);
+ buffer->count=ReadBlob(buffer->image,sizeof(buffer->data)-1,buffer->data);
if (buffer->count < 1)
return(EOF);
}
i=0;
while (buffer->offset < buffer->count)
buffer->data[i++]=buffer->data[buffer->offset++];
- count=ReadBlob(buffer->image,sizeof(buffer->data)-i,buffer->data+i);
+ count=ReadBlob(buffer->image,sizeof(buffer->data)-1-i,buffer->data+i);
buffer->count=i;
if (count > 0)
buffer->count+=count;