From 3cc372481f9ffb2224d1d02a07918423aca5583b Mon Sep 17 00:00:00 2001 From: pixel Date: Wed, 13 Aug 2008 08:46:52 +0000 Subject: SEEK_END needs to be checked against file_size instead --- mpq-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3