ci: fix -cflags -Werror jobs

pull/9611/head
Delyan Angelov 2021-04-05 23:42:26 +03:00
parent 19b915b105
commit d8cb24eef0
1 changed files with 4 additions and 3 deletions

View File

@ -170,15 +170,16 @@ pub fn execute(cmd string) Result {
output: 'exec("$cmd") failed'
}
}
buf := unsafe { &char(malloc(4096)) }
buf := unsafe { malloc(4096) }
mut res := strings.new_builder(1024)
defer {
unsafe { res.free() }
}
unsafe {
bufbp := buf
for C.fgets(bufbp, 4096, f) != 0 {
res.write_ptr(bufbp, vstrlen(bufbp))
for C.fgets(&char(bufbp), 4096, f) != 0 {
buflen := vstrlen(bufbp)
res.write_ptr(bufbp, buflen)
}
}
soutput := res.str()