diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-09-03 14:15:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-09-03 14:15:47 +0000 |
commit | 948506289c6fc3fc78bffe0b705e32ab879d61f7 (patch) | |
tree | d715a142405756a8fb63d5dde60c8e58cfa11620 | |
parent | 3c67abad5ea55f3a87a8e0e583db982d8ce99bd7 (diff) | |
download | libextractor-948506289c6fc3fc78bffe0b705e32ab879d61f7.tar.gz libextractor-948506289c6fc3fc78bffe0b705e32ab879d61f7.zip |
add another temporary variable to make clear that the result is unsigned
-rw-r--r-- | src/main/extractor_datasource.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/extractor_datasource.c b/src/main/extractor_datasource.c index f15321f..d25cc5b 100644 --- a/src/main/extractor_datasource.c +++ b/src/main/extractor_datasource.c | |||
@@ -321,6 +321,7 @@ bfds_seek (struct BufferedFileDataSource *bfds, | |||
321 | int64_t pos, int whence) | 321 | int64_t pos, int whence) |
322 | { | 322 | { |
323 | uint64_t npos; | 323 | uint64_t npos; |
324 | size_t nbpos; | ||
324 | 325 | ||
325 | switch (whence) | 326 | switch (whence) |
326 | { | 327 | { |
@@ -334,11 +335,11 @@ bfds_seek (struct BufferedFileDataSource *bfds, | |||
334 | (unsigned long long) bfds->fsize); | 335 | (unsigned long long) bfds->fsize); |
335 | return -1; | 336 | return -1; |
336 | } | 337 | } |
338 | nbpos = bfds->buffer_pos + pos; | ||
337 | if ( (NULL == bfds->buffer) || | 339 | if ( (NULL == bfds->buffer) || |
338 | ( (bfds->buffer_pos + pos < bfds->buffer_bytes) && | 340 | (nbpos < bfds->buffer_bytes) ) |
339 | (bfds->buffer_pos + pos >= 0) ) ) | ||
340 | { | 341 | { |
341 | bfds->buffer_pos += pos; | 342 | bfds->buffer_pos = nbpos; |
342 | return npos; | 343 | return npos; |
343 | } | 344 | } |
344 | if (0 != bfds_pick_next_buffer_at (bfds, | 345 | if (0 != bfds_pick_next_buffer_at (bfds, |