summaryrefslogtreecommitdiff
path: root/lib/sqfs/write_xattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/write_xattr.c')
-rw-r--r--lib/sqfs/write_xattr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqfs/write_xattr.c b/lib/sqfs/write_xattr.c
index 05f2775..ce606e3 100644
--- a/lib/sqfs/write_xattr.c
+++ b/lib/sqfs/write_xattr.c
@@ -84,14 +84,14 @@ static int write_value(meta_writer_t *mw, const char *value,
uint32_t offset;
uint64_t block;
+ meta_writer_get_position(mw, &block, &offset);
+ *value_ref_out = (block << 16) | (offset & 0xFFFF);
+
vent.size = htole32(strlen(value));
if (meta_writer_append(mw, &vent, sizeof(vent)))
return -1;
- meta_writer_get_position(mw, &block, &offset);
- *value_ref_out = (block << 16) | (offset & 0xFFFF);
-
if (meta_writer_append(mw, value, strlen(value)))
return -1;