mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
null terminate group messages (cause jfreegman can't str8 c)
This commit is contained in:
parent
26d119a17b
commit
5cde8a22f3
|
@ -1267,10 +1267,13 @@ static void handle_message_packet_group(Group_Chats *g_c, int groupnumber, const
|
|||
case PACKET_ID_MESSAGE: {
|
||||
if (msg_data_len == 0)
|
||||
return;
|
||||
uint8_t newmsg[msg_data_len+1];
|
||||
memcpy(newmsg, msg_data, msg_data_len);
|
||||
newmsg[msg_data_len] = 0;
|
||||
|
||||
//TODO
|
||||
if (g_c->message_callback)
|
||||
g_c->message_callback(g_c->m, groupnumber, index, msg_data, msg_data_len, g_c->message_callback_userdata);
|
||||
g_c->message_callback(g_c->m, groupnumber, index, newmsg, msg_data_len, g_c->message_callback_userdata);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -1470,4 +1473,4 @@ uint32_t copy_chatlist(const Messenger *m, int *out_list, uint32_t list_size)
|
|||
|
||||
return ret;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user