Commit 87e50171 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry
Browse files

Fix a 10L bug in the memory stream reader.

It's helpful if we don't always read from the start of the array.
Thanks to Matti Virolainen for the report.
parent 30074799
...@@ -105,7 +105,7 @@ static size_t op_mem_read(void *_ptr,size_t _size,size_t _nmemb,void *_stream){ ...@@ -105,7 +105,7 @@ static size_t op_mem_read(void *_ptr,size_t _size,size_t _nmemb,void *_stream){
_nmemb=(size-pos)/_size; _nmemb=(size-pos)/_size;
total=_size*_nmemb; total=_size*_nmemb;
} }
memcpy(_ptr,stream->data,total); memcpy(_ptr,stream->data+pos,total);
pos+=total; pos+=total;
stream->pos=pos; stream->pos=pos;
return _nmemb; return _nmemb;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment