diff --git a/common/common.go b/common/common.go index a3fa3eb..fc0c6dd 100644 --- a/common/common.go +++ b/common/common.go @@ -54,15 +54,17 @@ func ReadLinesOffsetN(filename string, offset uint, n int) ([]string, error) { func IntToString(orig []int8) string { ret := make([]byte, len(orig)) - size := 0 + size := -1 for i, o := range orig { if o == 0 { size = i break } - ret[i] = byte(o) } + if size == -1 { + size = len(orig) + } return string(ret[0:size]) }