From 083710dfc3b705727b75b9f8bbfcf7ed852a8f41 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 23 Jul 2002 18:11:12 +0000 Subject: [PATCH] Fixed entry loading. --- archivers/grp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/archivers/grp.c b/archivers/grp.c index d60a5954..2d675a26 100644 --- a/archivers/grp.c +++ b/archivers/grp.c @@ -334,7 +334,7 @@ static int grp_load_entries(const char *name, int forWriting, GRPinfo *info) { void *fh = NULL; PHYSFS_uint32 fileCount; - PHYSFS_uint32 location = 32; /* sizeof sig + sizeof 1st file header. */ + PHYSFS_uint32 location = 16; /* sizeof sig. */ GRPentry *entry; char *ptr; @@ -347,6 +347,8 @@ static int grp_load_entries(const char *name, int forWriting, GRPinfo *info) BAIL_MACRO(ERR_OUT_OF_MEMORY, 0); } /* if */ + location += (16 * fileCount); + for (entry = info->entries; fileCount > 0; fileCount--, entry++) { if (__PHYSFS_platformRead(fh, &entry->name, 12, 1) != 1) @@ -367,7 +369,7 @@ static int grp_load_entries(const char *name, int forWriting, GRPinfo *info) entry->size = PHYSFS_swapULE32(entry->size); entry->startPos = location; - location += entry->size + 16; + location += entry->size; } /* for */ __PHYSFS_platformClose(fh);