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

cgen: fix warnings (#5820)

This commit is contained in:
ka-weihe
2020-07-14 00:16:31 +02:00
committed by GitHub
parent 042add0e7f
commit df45488e09
14 changed files with 59 additions and 55 deletions

View File

@ -149,7 +149,7 @@ pub fn (s string) cstr() byteptr {
// cstring_to_vstring creates a copy of cstr and turns it into a v string
pub fn cstring_to_vstring(cstr byteptr) string {
slen := C.strlen(cstr)
slen := C.strlen(charptr(cstr))
mut s := byteptr(memdup(cstr, slen + 1))
s[slen] = `\0`
return tos(s, slen)