summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-07 10:41:32 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-07 10:41:49 +0200
commitae4193162e1607b75ef34e4e9a33e2b54f03af8a (patch)
treeed2b6ee2600e328cbf2a6b35e3bb97b014df4378
parent89d5c4a4c00ba11e5087f86ae35b76895a06220b (diff)
Fix forward seek when unpacking sparse files
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--lib/sqfs/data_reader.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqfs/data_reader.c b/lib/sqfs/data_reader.c
index 18719fe..e33ffbb 100644
--- a/lib/sqfs/data_reader.c
+++ b/lib/sqfs/data_reader.c
@@ -185,9 +185,9 @@ int data_reader_dump_file(data_reader_t *data, file_info_t *fi, int outfd,
if (allow_sparse) {
if (lseek(outfd, diff, SEEK_CUR) == (off_t)-1)
goto fail_sparse;
- } else {
- memset(data->block, 0, diff);
+ continue;
}
+ memset(data->block, 0, diff);
} else {
if (precache_data_block(data, off, fi->blocks[i].size))
return -1;