mirror of
https://github.com/lunarmodules/lua-iconv.git
synced 2025-06-22 20:24:36 +02:00
Replace call to luaL_typerror with a custom error message
The function luaL_typerror was removed from public API in Lua 5.2. This commit replaces it with calls to luaL_argerror and a custom error message.
This commit is contained in:
parent
fc22d5b632
commit
e394f70df0
@ -81,7 +81,8 @@ static iconv_t get_iconv_t(lua_State *L, int i) {
|
||||
luaL_error(L, "attempt to use an invalid " ICONV_TYPENAME);
|
||||
return cd;
|
||||
}
|
||||
luaL_typerror(L, i, ICONV_TYPENAME);
|
||||
luaL_argerror(L, i, lua_pushfstring(L, ICONV_TYPENAME " expected, got %s",
|
||||
luaL_typename(L, i)));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user