luaa: wlen() will return -1 on error
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
31aa7e66eb
commit
5afd258697
2
luaa.c
2
luaa.c
|
@ -192,7 +192,7 @@ static int
|
||||||
luaA_mbstrlen(lua_State *L)
|
luaA_mbstrlen(lua_State *L)
|
||||||
{
|
{
|
||||||
const char *cmd = luaL_checkstring(L, 1);
|
const char *cmd = luaL_checkstring(L, 1);
|
||||||
lua_pushnumber(L, mbstowcs(NULL, NONULL(cmd), 0));
|
lua_pushnumber(L, (ssize_t) mbstowcs(NULL, NONULL(cmd), 0));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue