Skip to content

Commit

Permalink
fix a minor bug when unpacking string from skynet_socket_message
Browse files Browse the repository at this point in the history
  • Loading branch information
linan0827 committed Oct 11, 2014
1 parent 9713b05 commit bfc3fd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lualib-src/lua-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit bfc3fd4

Please sign in to comment.