summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mpq-file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mpq-file.c b/mpq-file.c
index 3e1622e..6bd7b43 100644
--- a/mpq-file.c
+++ b/mpq-file.c
@@ -229,7 +229,7 @@ uint32_t mpqlib_seek(struct mpq_file_t * mpq_f, int32_t offset, enum mpqlib_file
case MPQLIB_SEEK_END:
if (offset > 0)
offset = 0;
- if ((mpq_f->cursor + offset) < 0)
+ if ((mpq_f->file_size + offset) < 0)
offset = -mpq_f->cursor;
mpq_f->cursor = mpq_f->file_size + offset;
break;