commit 6b18d819ffe42b3dc1611bb4abc16c5b51c610b6 parent 79585dea037e35066eb58c3a13b42c5b39d966df Author: Christian Grothoff <christian@grothoff.org> Date: Thu, 16 Aug 2012 22:52:15 +0000 fixes Diffstat:
| M | src/main/extractor_datasource.c | | | 13 | +++++++------ |
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/main/extractor_datasource.c b/src/main/extractor_datasource.c @@ -117,19 +117,20 @@ struct BufferedFileDataSource uint64_t fpos; /** - * Position within the buffer. + * Position within the buffer. Our absolute offset in the file + * is thus 'fpos + buffer_pos'. */ - uint64_t buffer_pos; + size_t buffer_pos; /** * Number of valid bytes in the buffer (<= buffer_size) */ - uint64_t buffer_bytes; + size_t buffer_bytes; /** * Allocated size of the buffer */ - uint64_t buffer_size; + size_t buffer_size; /** * Descriptor of the file to read data from (may be -1) @@ -377,8 +378,8 @@ bfds_seek (struct BufferedFileDataSource *bfds, return -1; } if ( (NULL == bfds->buffer) || - ( (bfds->buffer_pos + bfds->fpos <= pos) && - (bfds->buffer_pos + bfds->fpos + bfds->buffer_bytes > pos) ) ) + ( (bfds->fpos <= pos) && + (bfds->fpos + bfds->buffer_bytes > pos) ) ) { bfds->buffer_pos = pos - bfds->fpos; return pos;