diff options
author | Determinant <[email protected]> | 2019-06-11 01:59:04 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-06-11 01:59:04 -0400 |
commit | 1b2215ae2c792f96765a15c7ffcc6f20e3046cc7 (patch) | |
tree | e42e4d9f86c39130387da65765ca2a4b315722d9 /test_msgnet | |
parent | df87359ec575622687b5f6b8319fb30ba4340caf (diff) |
fix slice bugs
Diffstat (limited to 'test_msgnet')
-rw-r--r-- | test_msgnet/main.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test_msgnet/main.go b/test_msgnet/main.go index 0da5af7..230bd83 100644 --- a/test_msgnet/main.go +++ b/test_msgnet/main.go @@ -45,9 +45,9 @@ func msgHelloSerialize(name string, text string) salticidae.Msg { func msgHelloUnserialize(msg salticidae.Msg) MsgHello { p := msg.GetPayload() - length := binary.LittleEndian.Uint32(p.GetData(4)) - name := string(p.GetData(int(length))) - text := string(p.GetData(p.Size())) + length := binary.LittleEndian.Uint32(p.GetDataInPlace(4)) + name := string(p.GetDataInPlace(int(length))) + text := string(p.GetDataInPlace(p.Size())) p.Free() return MsgHello { name: name, text: text } } |