iconv: fix error check
On 64-bit iconv called via ffi returns a uint64_t cdata object, which equals to -1 in case of error so error handling works fine. On 32-bit it returns a number equal to (size_t)-1, which is equal to 4294967295 and not equal to -1 when compared to in Lua. As a result Lua binding to iconv hangs if the source string is incorrect. Fix this by comparing the result of iconv to ffi.cast('size_t', -1) instead of -1.
Loading
Please register or sign in to comment