summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2008-08-13 08:46:52 +0000
committerpixel <pixel>2008-08-13 08:46:52 +0000
commit3cc372481f9ffb2224d1d02a07918423aca5583b (patch)
tree938c131f25c963fa58190e867f49949825ebf2b7
parent87bf6e392a949958752741bb571fa7d29705b69f (diff)
SEEK_END needs to be checked against file_size instead
-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;