commit 948506289c6fc3fc78bffe0b705e32ab879d61f7
parent 3c67abad5ea55f3a87a8e0e583db982d8ce99bd7
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 3 Sep 2012 14:15:47 +0000
add another temporary variable to make clear that the result is unsigned
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/main/extractor_datasource.c b/src/main/extractor_datasource.c
@@ -321,6 +321,7 @@ bfds_seek (struct BufferedFileDataSource *bfds,
int64_t pos, int whence)
{
uint64_t npos;
+ size_t nbpos;
switch (whence)
{
@@ -334,11 +335,11 @@ bfds_seek (struct BufferedFileDataSource *bfds,
(unsigned long long) bfds->fsize);
return -1;
}
+ nbpos = bfds->buffer_pos + pos;
if ( (NULL == bfds->buffer) ||
- ( (bfds->buffer_pos + pos < bfds->buffer_bytes) &&
- (bfds->buffer_pos + pos >= 0) ) )
+ (nbpos < bfds->buffer_bytes) )
{
- bfds->buffer_pos += pos;
+ bfds->buffer_pos = nbpos;
return npos;
}
if (0 != bfds_pick_next_buffer_at (bfds,