psi: trimming excess bytes in gps data from pmt

This commit is contained in:
saxon 2018-12-14 13:46:10 +10:30
parent 798add533b
commit dc6964d41c
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,7 @@ LICENSE
package psi
import (
"bytes"
"encoding/binary"
"errors"
"hash/crc32"
@ -101,6 +102,7 @@ func GpsOf(p []byte) (g string, err error) {
return "", err
}
gBytes := p[gpsDataIndx : gpsDataIndx+gpsDataSize]
gBytes = bytes.Trim(gBytes, "\x00")
g = string(gBytes)
return g, nil
}