libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit ec387005417c741e468f3343bff43dea62cc4b38
parent cba315654e43edf66ba53d4fe1012a47ae0d27b8
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon,  3 Sep 2012 13:46:45 +0000

use unsigned for pos

Diffstat:
Msrc/main/extractor_datasource.c | 5+++--
Msrc/main/extractor_datasource.h | 2+-
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/extractor_datasource.c b/src/main/extractor_datasource.c @@ -1012,7 +1012,7 @@ cfs_read (struct CompressedFileSource *cfs, */ static int64_t cfs_seek (struct CompressedFileSource *cfs, - uint64_t position, + int64_t position, int whence) { uint64_t nposition; @@ -1023,6 +1023,7 @@ cfs_seek (struct CompressedFileSource *cfs, case SEEK_CUR: if (cfs->fpos + position < 0) { + /* underflow */ LOG ("Invalid seek operation\n"); return -1; } @@ -1353,7 +1354,7 @@ EXTRACTOR_datasource_read_ (void *cls, */ int64_t EXTRACTOR_datasource_seek_ (void *cls, - uint64_t pos, + int64_t pos, int whence) { struct EXTRACTOR_Datasource *ds = cls; diff --git a/src/main/extractor_datasource.h b/src/main/extractor_datasource.h @@ -97,7 +97,7 @@ EXTRACTOR_datasource_read_ (void *cls, */ int64_t EXTRACTOR_datasource_seek_ (void *cls, - uint64_t pos, + int64_t pos, int whence);