1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/pkg/platform/utsname_uint8.go
Stefan Scherer 7c1d49d90c Move charsToString to architecture dependent source to fix casting problem
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
2015-11-19 18:09:08 +01:00

18 lines
439 B
Go

// +build linux,arm linux,ppc64 linux,ppc64le s390x
// see golang's sources src/syscall/ztypes_linux_*.go that use uint8
package platform
// Convert the OS/ARCH-specific utsname.Machine to string
// given as an array of unsigned uint8
func charsToString(ca [65]uint8) string {
s := make([]byte, len(ca))
var lens int
for ; lens < len(ca); lens++ {
if ca[lens] == 0 {
break
}
s[lens] = ca[lens]
}
return string(s[0:lens])
}