should not copy the ending 0

This commit is contained in:
Cloud Wu
2014-10-15 10:16:28 +08:00
parent b39fc6ee23
commit 1ef5430e0a

View File

@@ -47,7 +47,7 @@ forward_message(int type, bool padding, struct socket_message * result) {
sm->ud = result->ud;
if (padding) {
sm->buffer = NULL;
strcpy((char*)(sm+1), result->data);
memcpy(sm+1, result->data, sz - sizeof(*sm));
} else {
sm->buffer = result->data;
}