Fix NULL chars in string while reading id3v11 tags

This commit is contained in:
jo 2018-09-02 19:22:37 +02:00
parent 43725ee9b6
commit 3543a25cd7

View File

@ -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) {