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:
parent
802da8f31d
commit
a4d2633a33
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user