Skip to content

Commit

Permalink
print fseeko error
Browse files Browse the repository at this point in the history
  • Loading branch information
wookietreiber committed Nov 4, 2015
1 parent 8879834 commit 7fb07ef
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,18 +344,21 @@ static lzma_index *next_index(off_t *pos) {
}

bool decode_index(void) {
if (fseeko(gInFile, 0, SEEK_END) == -1)
if (fseeko(gInFile, 0, SEEK_END) == -1) {
fprintf(stderr, "can not seek in input: %s\n", strerror(errno));
return false; // not seekable
}

off_t pos = ftello(gInFile);

gIndex = NULL;
while (pos > 0) {
lzma_index *index = next_index(&pos);
if (gIndex && lzma_index_cat(index, gIndex, NULL) != LZMA_OK)
die("Error concatenating indices");
gIndex = index;
}

return (gIndex != NULL);
}

Expand Down

0 comments on commit 7fb07ef

Please sign in to comment.