summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-25 22:57:28 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-25 22:57:28 +0200
commitf53a5948234fa7e4c11c38ee0a0b5ec43a5a7447 (patch)
treeba8cc16e9409165fcfb11c57587faeb1ed25435a /lib
parent5cf5e39e051161b79e9bbe9145ecb9238a6aa19a (diff)
Fix acciedental usage of left over local variable instead struct member
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/sqfs/frag_reader.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sqfs/frag_reader.c b/lib/sqfs/frag_reader.c
index 2adfe01..0436a17 100644
--- a/lib/sqfs/frag_reader.c
+++ b/lib/sqfs/frag_reader.c
@@ -65,7 +65,6 @@ static int precache_block(frag_reader_t *f, size_t i)
frag_reader_t *frag_reader_create(sqfs_super_t *super, int fd,
compressor_t *cmp)
{
- sqfs_fragment_t *tbl = NULL;
frag_reader_t *f = NULL;
size_t i;
@@ -81,7 +80,7 @@ frag_reader_t *frag_reader_create(sqfs_super_t *super, int fd,
f->cmp = cmp;
f->fd = fd;
- f->tbl = sqfs_read_table(fd, cmp, sizeof(tbl[0]) * f->num_fragments,
+ f->tbl = sqfs_read_table(fd, cmp, sizeof(f->tbl[0]) * f->num_fragments,
super->fragment_table_start);
if (f->tbl == NULL) {
free(f);
@@ -89,8 +88,8 @@ frag_reader_t *frag_reader_create(sqfs_super_t *super, int fd,
}
for (i = 0; i < f->num_fragments; ++i) {
- tbl[i].start_offset = le64toh(tbl[i].start_offset);
- tbl[i].size = le32toh(tbl[i].size);
+ f->tbl[i].start_offset = le64toh(f->tbl[i].start_offset);
+ f->tbl[i].size = le32toh(f->tbl[i].size);
}
return f;