2 arg form of ffi.copy not supported
justincormack opened this issue · comments
Justin Cormack commented
This should work:
local ffi = require "ffi"
s = "test"
c = ffi.new("char[40]")
ffi.copy(c, s)
for copying Lua strings, the 2 argument form of ffi.copy, but we get
lua: tmp.lua:7: bad argument #3 to 'copy' (number expected, got table)
stack traceback:
[C]: in function 'copy'
tmp.lua:7: in main chunk
[C]: ?