diff --git a/util.go b/util.go index ec28ac6..4858802 100644 --- a/util.go +++ b/util.go @@ -5,6 +5,7 @@ package tag import ( + "bytes" "encoding/binary" "io" ) @@ -46,7 +47,7 @@ func readString(r io.Reader, n int) (string, error) { if err != nil { return "", err } - return string(b), nil + return string(bytes.Trim(b, "\x00")), nil } func readInt(r io.Reader, n int) (int, error) {