1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

string: Properly null-terminate repeated string

This commit is contained in:
lutherwenxu 2019-09-28 18:31:12 +08:00 committed by Alexander Medvednikov
parent 802da8f31d
commit a4d2633a33

View File

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