luaa: wlen() will return -1 on error

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-03-15 10:01:25 +01:00
parent 31aa7e66eb
commit 5afd258697
1 changed files with 1 additions and 1 deletions

2
luaa.c
View File

@ -192,7 +192,7 @@ static int
luaA_mbstrlen(lua_State *L)
{
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;
}