Skip to content

Commit

Permalink
Fixed entry loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 23, 2002
1 parent e460c9c commit 083710d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions archivers/grp.c
Expand Up @@ -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;

Expand All @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 083710d

Please sign in to comment.