From 7fb07efef7a62cb3ec45378cc5e8bc13c271d402 Mon Sep 17 00:00:00 2001 From: Christian Krause Date: Wed, 4 Nov 2015 13:40:40 +0100 Subject: [PATCH] print fseeko error --- src/common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common.c b/src/common.c index ade5505..701b343 100644 --- a/src/common.c +++ b/src/common.c @@ -344,10 +344,13 @@ 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); @@ -355,7 +358,7 @@ bool decode_index(void) { die("Error concatenating indices"); gIndex = index; } - + return (gIndex != NULL); }