psi: using array in TimeBytes()

This commit is contained in:
saxon 2018-12-14 16:22:48 +10:30
parent 404a2b6c99
commit f7991cd0af
1 changed files with 3 additions and 3 deletions

View File

@ -37,10 +37,10 @@ import (
// timeBytes takes a timestamp as an uint64 and converts to an 8 byte slice -
// allows for updating of timestamp in pmt time descriptor.
func TimeBytes(t uint64) (s []byte) {
s = make([]byte, timeDataSize)
func TimeBytes(t uint64) []byte {
var s [timeDataSize]byte
binary.BigEndian.PutUint64(s[:], t)
return s
return s[:]
}
// ChkTime takes a psi as a byte slice and checks to see if it has a time descriptor