From ad9ac6d07ce1819260c2b7f090fd4fe742c80d9f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 10 Jul 2022 23:49:07 -0600 Subject: Fuzz btrfsitem, and by consequence improve binstruct errors --- lib/btrfs/internal/misc.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/btrfs/internal/misc.go') diff --git a/lib/btrfs/internal/misc.go b/lib/btrfs/internal/misc.go index d4bd768..49fe2bd 100644 --- a/lib/btrfs/internal/misc.go +++ b/lib/btrfs/internal/misc.go @@ -5,6 +5,7 @@ package internal import ( + "fmt" "time" "git.lukeshu.com/btrfs-progs-ng/lib/binstruct" @@ -20,6 +21,10 @@ type Key struct { binstruct.End `bin:"off=0x11"` } +func (k Key) String() string { + return fmt.Sprintf("{%v %v %v}", k.ObjectID, k.ItemType, k.Offset) +} + func (a Key) Cmp(b Key) int { if d := util.CmpUint(a.ObjectID, b.ObjectID); d != 0 { return d -- cgit v1.2.3-54-g00ecf