Fix NULL chars in string while reading id3v11 tags
This commit is contained in:
parent
43725ee9b6
commit
3543a25cd7
3
util.go
3
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user