Update netlink vendoring (#1471)
* github.com/ema/qdisc * github.com/mdlayher/genetlink * github.com/mdlayher/wifi Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
8c3de12c22
commit
0e77317955
245 changed files with 6515 additions and 1699 deletions
6
vendor/github.com/mdlayher/netlink/nlenc/string.go
generated
vendored
6
vendor/github.com/mdlayher/netlink/nlenc/string.go
generated
vendored
|
|
@ -10,5 +10,9 @@ func Bytes(s string) []byte {
|
|||
// String returns a string with the contents of b from a null-terminated
|
||||
// byte slice.
|
||||
func String(b []byte) string {
|
||||
return string(bytes.TrimSuffix(b, []byte{0x00}))
|
||||
// If the string has more than one NULL terminator byte, we want to remove
|
||||
// all of them before returning the string to the caller; hence the use of
|
||||
// strings.TrimRight instead of strings.TrimSuffix (which previously only
|
||||
// removed a single NULL).
|
||||
return string(bytes.TrimRight(b, "\x00"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue