From 5afd2586970e23165c900e03e6ee600e6d5a8ccd Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 15 Mar 2009 10:01:25 +0100 Subject: [PATCH] luaa: wlen() will return -1 on error Signed-off-by: Julien Danjou --- luaa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luaa.c b/luaa.c index e25dea50c..9ce3a8a03 100644 --- a/luaa.c +++ b/luaa.c @@ -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; }