aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorenginix <wnd1024@gmail.com>2016-07-04 16:38:37 +0800
committerenginix <wnd1024@gmail.com>2016-07-04 16:38:37 +0800
commitc87f953d81420e64cb5bb324ae3ca15f1bb28b1a (patch)
tree10de395068a8d84bcd806165aff88d69ccf4c5a6
parent9f77f8b24f7fcce66678b5c73ca82ceb23576536 (diff)
downloadluasocket-c87f953d81420e64cb5bb324ae3ca15f1bb28b1a.tar.gz
luasocket-c87f953d81420e64cb5bb324ae3ca15f1bb28b1a.tar.bz2
luasocket-c87f953d81420e64cb5bb324ae3ca15f1bb28b1a.zip
fix unixudp object checking issue
-rw-r--r--src/unixudp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/unixudp.c b/src/unixudp.c
index 75f5b08..1088c6b 100644
--- a/src/unixudp.c
+++ b/src/unixudp.c
@@ -161,7 +161,7 @@ static int meth_sendto(lua_State *L)
161} 161}
162 162
163static int meth_receive(lua_State *L) { 163static int meth_receive(lua_State *L) {
164 p_unix un = (p_unix) auxiliar_checkclass(L, "unixudp{any}", 1); 164 p_unix un = (p_unix) auxiliar_checkgroup(L, "unixudp{any}", 1);
165 char buf[UNIXUDP_DATAGRAMSIZE]; 165 char buf[UNIXUDP_DATAGRAMSIZE];
166 size_t got, wanted = (size_t) luaL_optnumber(L, 2, sizeof(buf)); 166 size_t got, wanted = (size_t) luaL_optnumber(L, 2, sizeof(buf));
167 char *dgram = wanted > sizeof(buf)? (char *) malloc(wanted): buf; 167 char *dgram = wanted > sizeof(buf)? (char *) malloc(wanted): buf;
@@ -317,7 +317,7 @@ static const char *unixudp_tryconnect(p_unix un, const char *path)
317 317
318static int meth_connect(lua_State *L) 318static int meth_connect(lua_State *L)
319{ 319{
320 p_unix un = (p_unix) auxiliar_checkclass(L, "unixudp{any}", 1); 320 p_unix un = (p_unix) auxiliar_checkgroup(L, "unixudp{any}", 1);
321 const char *path = luaL_checkstring(L, 2); 321 const char *path = luaL_checkstring(L, 2);
322 const char *err = unixudp_tryconnect(un, path); 322 const char *err = unixudp_tryconnect(un, path);
323 if (err) { 323 if (err) {