string: Properly null-terminate repeated string

pull/2148/head
lutherwenxu 2019-09-28 18:31:12 +08:00 committed by Alexander Medvednikov
parent 802da8f31d
commit a4d2633a33
1 changed files with 1 additions and 0 deletions

View File

@ -1021,5 +1021,6 @@ pub fn (s string) repeat(count int) string {
ret[i*s.len + j] = s[j]
}
}
ret[s.len * count] = 0
return string(ret)
}