mirror of
https://github.com/facebook/zstd.git
synced 2025-10-07 00:12:40 -04:00
fixed wrong assert condition
This commit is contained in:
parent
a1d7b9d654
commit
6c0bfc468c
@ -120,16 +120,16 @@ static int ZSTD_seekable_seek_buff(void* opaque, long long offset, int origin)
|
|||||||
buffWrapper_t* const buff = (buffWrapper_t*) opaque;
|
buffWrapper_t* const buff = (buffWrapper_t*) opaque;
|
||||||
unsigned long long newOffset;
|
unsigned long long newOffset;
|
||||||
assert(buff != NULL);
|
assert(buff != NULL);
|
||||||
assert(offset >= 0);
|
|
||||||
switch (origin) {
|
switch (origin) {
|
||||||
case SEEK_SET:
|
case SEEK_SET:
|
||||||
|
assert(offset >= 0);
|
||||||
newOffset = (unsigned long long)offset;
|
newOffset = (unsigned long long)offset;
|
||||||
break;
|
break;
|
||||||
case SEEK_CUR:
|
case SEEK_CUR:
|
||||||
newOffset = (unsigned long long)buff->pos + (unsigned long long)offset;
|
newOffset = (unsigned long long)((long long)buff->pos + offset);
|
||||||
break;
|
break;
|
||||||
case SEEK_END:
|
case SEEK_END:
|
||||||
newOffset = (unsigned long long)buff->size + (unsigned long long)offset;
|
newOffset = (unsigned long long)((long long)buff->size + offset);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0); /* not possible */
|
assert(0); /* not possible */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user