Closed vsergeev closed 4 years ago
local ffi = jit and require('ffi') or require('cffi') ffi.cdef[[ struct foo { char str[4]; }; ]] local f = ffi.new("struct foo") f.str = "abc" --> expected: no error, get: "invalid C type" print(ffi.string(f.str)) --> abc f.str = "abcd1234" print(ffi.string(f.str)) --> abcd