From 87bf6e392a949958752741bb571fa7d29705b69f Mon Sep 17 00:00:00 2001 From: pixel Date: Wed, 13 Aug 2008 08:39:05 +0000 Subject: Fixing seek. --- mpq-file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mpq-file.c b/mpq-file.c index ad5d51b..3e1622e 100644 --- a/mpq-file.c +++ b/mpq-file.c @@ -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: -- cgit v1.2.3