Skip to content
Snippets Groups Projects
Commit 2eb927d2 authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

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.
parent a362eff6
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment