fix a minor bug when unpacking string from skynet_socket_message

This commit is contained in:
Nan Li
2014-10-12 03:20:18 +08:00
parent 9713b055a0
commit bfc3fd425a

View File

@@ -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);
}