summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-20 08:13:28 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-20 08:13:28 +0200
commit93f5a822b208b7df1c9a3f15685f397e0ce344aa (patch)
tree332f66e76268aed50680d4fdc6381d13067a0add
parent8b54f42d9f0513860993945184aedcbe7f00604d (diff)
Get rid of unalligned pointers
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--lib/sqfs/id_table_write.c5
-rw-r--r--mkfs/mkfs.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/sqfs/id_table_write.c b/lib/sqfs/id_table_write.c
index 490c2af..9a5aa48 100644
--- a/lib/sqfs/id_table_write.c
+++ b/lib/sqfs/id_table_write.c
@@ -5,6 +5,7 @@
int id_table_write(id_table_t *tbl, int outfd, sqfs_super_t *super,
compressor_t *cmp)
{
+ uint64_t start;
size_t i;
int ret;
@@ -14,7 +15,9 @@ int id_table_write(id_table_t *tbl, int outfd, sqfs_super_t *super,
super->id_count = tbl->num_ids;
ret = sqfs_write_table(outfd, super, tbl->ids, sizeof(tbl->ids[0]),
- tbl->num_ids, &super->id_table_start, cmp);
+ tbl->num_ids, &start, cmp);
+
+ super->id_table_start = start;
for (i = 0; i < tbl->num_ids; ++i)
tbl->ids[i] = le32toh(tbl->ids[i]);
diff --git a/mkfs/mkfs.c b/mkfs/mkfs.c
index 56f8842..dac0a34 100644
--- a/mkfs/mkfs.c
+++ b/mkfs/mkfs.c
@@ -41,6 +41,7 @@ int main(int argc, char **argv)
{
int status = EXIT_FAILURE, ret;
sqfs_info_t info;
+ uint64_t start;
memset(&info, 0, sizeof(info));
@@ -109,10 +110,12 @@ int main(int argc, char **argv)
if (sqfs_write_table(info.outfd, &info.super, info.fragments,
sizeof(info.fragments[0]), info.num_fragments,
- &info.super.fragment_table_start, info.cmp)) {
+ &start, info.cmp)) {
goto out_cmp;
}
+ info.super.fragment_table_start = start;
+
if (id_table_write(&info.idtbl, info.outfd, &info.super, info.cmp))
goto out_cmp;