diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-12 11:29:56 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-12 14:28:49 -0700 |
commit | 09190693dfc81471b5edf3705a77fc54a89e8782 (patch) | |
tree | 2e4323201faff7dd40a8627b048711dfe52f6d32 /lib/btrfs/btrfsitem | |
parent | ffabc8c276fcdc97bc15193d511622c4356cdcf0 (diff) |
btrfsitem: DirEntry: Fix XATTR name/value ordering
Diffstat (limited to 'lib/btrfs/btrfsitem')
-rw-r--r-- | lib/btrfs/btrfsitem/item_dir.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/btrfs/btrfsitem/item_dir.go b/lib/btrfs/btrfsitem/item_dir.go index b3e33f4..584e44d 100644 --- a/lib/btrfs/btrfsitem/item_dir.go +++ b/lib/btrfs/btrfsitem/item_dir.go @@ -49,10 +49,10 @@ func (o *DirEntry) UnmarshalBinary(dat []byte) (int, error) { if err := binutil.NeedNBytes(dat, 0x1e+int(o.DataLen)+int(o.NameLen)); err != nil { return 0, err } - o.Data = dat[n : n+int(o.DataLen)] - n += int(o.DataLen) o.Name = dat[n : n+int(o.NameLen)] n += int(o.NameLen) + o.Data = dat[n : n+int(o.DataLen)] + n += int(o.DataLen) return n, nil } @@ -63,8 +63,8 @@ func (o DirEntry) MarshalBinary() ([]byte, error) { if err != nil { return dat, err } - dat = append(dat, o.Data...) dat = append(dat, o.Name...) + dat = append(dat, o.Data...) return dat, nil } |