Ver Fonte

fix: l_i2s_send的类型判断错误, lua_type并不会返回LUA_TINTEGER

Wendal Chen há 1 ano atrás
pai
commit
2772a6d82d
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      luat/modules/luat_lib_i2s.c

+ 1 - 1
luat/modules/luat_lib_i2s.c

@@ -144,7 +144,7 @@ static int l_i2s_send(lua_State *L) {
     else {
         buff = (char*)luaL_checklstring(L, 2, &len);
     }
-    if (lua_type(L, 3) == LUA_TINTEGER) {
+    if (lua_type(L, 3) == LUA_TNUMBER) {
         len = luaL_checkinteger(L, 3);
     }
     int ret = luat_i2s_send(id, buff, len);