Cosmos Nicolaou | 8feb306 | 2014-08-19 17:09:40 -0700 | [diff] [blame] | 1 | // +build linux,!arm |
Cosmos Nicolaou | 9869807 | 2014-08-19 16:44:53 -0700 | [diff] [blame] | 2 | |
3 | package profiles | ||||
4 | |||||
5 | // str converts the input byte slice to a string, ignoring everything following | ||||
6 | // a null character (including the null character). | ||||
7 | func utsStr(c []int8) string { | ||||
8 | ret := make([]byte, 0, len(c)) | ||||
9 | for _, v := range c { | ||||
10 | if v == 0 { | ||||
11 | break | ||||
12 | } | ||||
13 | ret = append(ret, byte(v)) | ||||
14 | } | ||||
15 | return string(ret) | ||||
16 | } |