diff options
| author | ruki <[email protected]> | 2025-11-09 22:34:50 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-09 22:34:50 +0800 |
| commit | bf2da8a3d7f04bf5ffcdce8fd4c334d5421d3494 (patch) | |
| tree | 054a98d5d2b875f9bb552c6848a31877e5afde4c /core/src/xmake/io/socket_accept.c | |
| parent | f2f3821a0248b24941566c90e7aabcc0e7d95e77 (diff) | |
format core
Diffstat (limited to 'core/src/xmake/io/socket_accept.c')
| -rw-r--r-- | core/src/xmake/io/socket_accept.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/src/xmake/io/socket_accept.c b/core/src/xmake/io/socket_accept.c index 77a6c6c86..5aed6d263 100644 --- a/core/src/xmake/io/socket_accept.c +++ b/core/src/xmake/io/socket_accept.c @@ -39,8 +39,9 @@ tb_int_t xm_io_socket_accept(lua_State *lua) { tb_assert_and_check_return_val(lua, 0); // is pointer? - if (!xm_lua_ispointer(lua, 1)) + if (!xm_lua_ispointer(lua, 1)) { return 0; + } // get socket tb_socket_ref_t sock = (tb_socket_ref_t)xm_lua_topointer(lua, 1); @@ -48,9 +49,10 @@ tb_int_t xm_io_socket_accept(lua_State *lua) { // accept socket tb_socket_ref_t client = tb_socket_accept(sock, tb_null); - if (client) + if (client) { xm_lua_pushpointer(lua, (tb_pointer_t)client); - else + } else { lua_pushnil(lua); + } return 1; } |
