From bfc3fd425a3a0eb23a0dbf62cdbe1f66272ef386 Mon Sep 17 00:00:00 2001 From: Nan Li Date: Sun, 12 Oct 2014 03:20:18 +0800 Subject: [PATCH] fix a minor bug when unpacking string from skynet_socket_message --- lualib-src/lua-socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lualib-src/lua-socket.c b/lualib-src/lua-socket.c index 81322d17c..094c958f3 100644 --- a/lualib-src/lua-socket.c +++ b/lualib-src/lua-socket.c @@ -368,7 +368,7 @@ lunpack(lua_State *L) { lua_pushinteger(L, message->id); lua_pushinteger(L, message->ud); if (message->buffer == NULL) { - lua_pushlstring(L, (char *)(message+1),size - sizeof(*message)); + lua_pushlstring(L, (char *)(message+1),size - sizeof(*message) - 1); } else { lua_pushlightuserdata(L, message->buffer); }