zlib.lua fails on Linux
opened this issue · comments
Deleted user commented
Probably others do as well, but I needed a complete FFI interface to zlib and found this one.
The problem is in the ffi.load
line:
local zlib = ffi.load( ffi_zlib_lib or libs[ ffi.os ][ ffi.arch ] or "z" )
It should be:
local zlib = ffi.load( ffi_zlib_lib or libs[ ffi.os ] and libs[ ffi.os ][ ffi.arch ] or "z" )
The problem should be obvious from the fix (libs[ffi.os]
not defined thus it crashes trying to access libs[ffi.os][ffi.arch]
).