Support `char [N]` assignment from string
vsergeev opened this issue · 0 comments
vsergeev commented
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