mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
cgen: minor fixes
This commit is contained in:
parent
c514f0b672
commit
fe6707b26d
4 changed files with 8 additions and 7 deletions
|
@ -392,10 +392,10 @@ fn (s string) add(a string) string {
|
|||
str: malloc(new_len + 1)
|
||||
}
|
||||
for j in 0..s.len {
|
||||
res[j] = s[j]
|
||||
res.str[j] = s.str[j]
|
||||
}
|
||||
for j in 0..a.len {
|
||||
res[s.len + j] = a[j]
|
||||
res.str[s.len + j] = a.str[j]
|
||||
}
|
||||
res.str[new_len] = `\0` // V strings are not null terminated, but just in case
|
||||
return res
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue