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

cgen: generate init()

This commit is contained in:
Alexander Medvednikov
2020-03-21 09:29:16 +01:00
parent c93f515a54
commit e57804e6c2
4 changed files with 30 additions and 19 deletions

View File

@ -72,7 +72,9 @@ pub fn (b &Builder) after(n int) string {
return ''
}
buf := b.buf[n..]
return string(buf.clone())
mut copy := buf.clone()
copy << `\0`
return string(copy)
}
pub fn (b mut Builder) str() string {