diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-08-28 11:43:32 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-09-06 08:14:14 +0900 |
commit | 4d183305bda821c50db12748f27d64188ee7b4c1 (patch) | |
tree | 895d7b2ad758046763d094088cf547daf662d73b | |
parent | 9d3dc914c6ef915d97fa7bcd74011ae222d4a1f5 (diff) |
zebra/zapi: Remove unnecessary NULL chars after interface name
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
-rw-r--r-- | zebra/zapi.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/zapi.go b/zebra/zapi.go index 01e8d2ff..d652b60c 100644 --- a/zebra/zapi.go +++ b/zebra/zapi.go @@ -594,7 +594,7 @@ func (b *InterfaceUpdateBody) DecodeFromBytes(data []byte, version uint8) error return fmt.Errorf("lack of bytes. need %d but %d", INTERFACE_NAMSIZ+29, len(data)) } - b.Name = string(data[:INTERFACE_NAMSIZ]) + b.Name = strings.Trim(string(data[:INTERFACE_NAMSIZ]), "\u0000") data = data[INTERFACE_NAMSIZ:] b.Index = binary.BigEndian.Uint32(data[:4]) b.Status = INTERFACE_STATUS(data[4]) |