diff options
-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: |