mirror of https://bitbucket.org/ausocean/av.git
psi: trimming excess bytes in gps data from pmt
This commit is contained in:
parent
798add533b
commit
dc6964d41c
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue