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

builtin: fix a bug in []string.join()

This commit is contained in:
Delyan Angelov 2021-03-23 20:14:46 +02:00
parent 8abfe2f5a2
commit 419ee8ae2a
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -1576,7 +1576,7 @@ pub fn (a []string) join(del string) string {
}
len -= del.len
// Allocate enough memory
mut res := ''
mut res := string{}
res.len = len
res.str = unsafe { malloc(res.len + 1) }
mut idx := 0