diff options
author | pixel <pixel> | 2008-08-13 08:39:05 +0000 |
---|---|---|
committer | pixel <pixel> | 2008-08-13 08:39:05 +0000 |
commit | 87bf6e392a949958752741bb571fa7d29705b69f (patch) | |
tree | f02b6f8f81bf9c1b1f5d8fb7e4abbef75a64cd68 | |
parent | dffe2a032c57d4e00ae82a5c6ac70093566936bf (diff) |
Fixing seek.
-rw-r--r-- | mpq-file.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -222,15 +222,15 @@ uint32_t mpqlib_seek(struct mpq_file_t * mpq_f, int32_t offset, enum mpqlib_file mpq_f->cursor = offset; break; case MPQLIB_SEEK_CUR: - if ((-offset) >= mpq_f->cursor) + if ((mpq_f->cursor + offset) < 0) offset = -mpq_f->cursor; mpq_f->cursor += offset; break; case MPQLIB_SEEK_END: if (offset > 0) offset = 0; - if ((-offset) >= mpq_f->file_size) - offset = -mpq_f->file_size; + if ((mpq_f->cursor + offset) < 0) + offset = -mpq_f->cursor; mpq_f->cursor = mpq_f->file_size + offset; break; default: |