11 lines
190 B
Go
11 lines
190 B
Go
package utils
|
|
|
|
// Clen returns the length of a null terminated string like in C
|
|
func Clen(n []byte) int {
|
|
for i := 0; i < len(n); i++ {
|
|
if n[i] == 0 {
|
|
return i
|
|
}
|
|
}
|
|
return len(n)
|
|
}
|