diff --git a/src/chat/misc.c b/src/chat/misc.c index 14aea58..ecc96ab 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -739,7 +739,7 @@ void *why2_communicate_thread(void *arg) connection_node_t pm_connection_node = *(connection_node_t*) pm_connection -> value; //ALLOCATE MESSAGE TO SEND TO RECEIVER - char *private_msg = why2_malloc(strlen(WHY2_CHAT_CODE_PM_SERVER) + strlen(node.username) + strlen(pm_connection_node.username) + strlen(msg) + 5); + char *private_msg = why2_malloc(strlen(WHY2_CHAT_CODE_PM_SERVER) + strlen(node.username) + strlen(pm_connection_node.username) + strlen(msg) + 6); //CONSTRUCT DA MESSAGE sprintf(private_msg, WHY2_CHAT_CODE_PM_SERVER ";%s;%s;%s;%c", node.username, pm_connection_node.username, msg, '\0');