Navigation Menu

Skip to content

Commit

Permalink
Logic fixes; seems to work rather well with KenBuild, now.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 9, 2001
1 parent 2827a86 commit ce29f03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions archivers/grp.c
Expand Up @@ -82,7 +82,7 @@ static int GRP_read(FileHandle *handle, void *buffer,

errno = 0;
retval = fread(buffer, objSize, objCount, fh);
finfo->curPos += retval;
finfo->curPos += (retval * objSize);
BAIL_IF_MACRO((retval < objCount) && (ferror(fh)),strerror(errno),retval);

return(retval);
Expand All @@ -106,7 +106,7 @@ static int GRP_tell(FileHandle *handle)
static int GRP_seek(FileHandle *handle, int offset)
{
GRPfileinfo *finfo = (GRPfileinfo *) (handle->opaque);
int newPos = finfo->curPos + offset;
int newPos = finfo->startPos + offset;

BAIL_IF_MACRO(offset < 0, ERR_INVALID_ARGUMENT, 0);
BAIL_IF_MACRO(newPos > finfo->startPos + finfo->size, ERR_PAST_EOF, 0);
Expand Down Expand Up @@ -242,7 +242,7 @@ static int getFileEntry(DirHandle *h, const char *name, int *size)
FILE *fh = g->handle;
int i;
char *ptr;
int retval = 0; /*(g->totalEntries + 1) * 16;*/ /* offset of raw file data */
int retval = (g->totalEntries + 1) * 16; /* offset of raw file data */

/* Rule out filenames to avoid unneeded file i/o... */
if (strchr(name, '/') != NULL) /* no directories in groupfiles. */
Expand Down

0 comments on commit ce29f03

Please sign in to comment.