summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2026-01-21 22:35:48 +0800
committerruki <[email protected]>2026-01-21 22:35:48 +0800
commita5d36f788b15128587e6eb020c77db376215e6f4 (patch)
treef3f986db06a40f96456e81e6cdc038e76d597c52 /core/src
parent66cb827ce1522ba5d123a0e466b078155e874679 (diff)
fix error again
Diffstat (limited to 'core/src')
-rw-r--r--core/src/xmake/utf8/len.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/xmake/utf8/len.c b/core/src/xmake/utf8/len.c
index f9819ec3b..3e1f35bf5 100644
--- a/core/src/xmake/utf8/len.c
+++ b/core/src/xmake/utf8/len.c
@@ -37,8 +37,8 @@ tb_int_t xm_utf8_len(lua_State *lua) {
size_t len;
tb_char_t const* s = luaL_checklstring(lua, 1, &len);
- lua_Integer posi = xm_utf8_posrelat(luaL_optinteger(lua, 2, 1), len);
- lua_Integer posj = xm_utf8_posrelat(luaL_optinteger(lua, 3, -1), len);
+ lua_Integer posi = xm_utf8_posrelat((tb_long_t)luaL_optinteger(lua, 2, 1), len);
+ lua_Integer posj = xm_utf8_posrelat((tb_long_t)luaL_optinteger(lua, 3, -1), len);
tb_bool_t lax = lua_toboolean(lua, 4);
luaL_argcheck(lua, 1 <= posi && --posi <= (lua_Integer)len, 2, "initial position out of bounds");
luaL_argcheck(lua, --posj < (lua_Integer)len, 3, "final position out of bounds");