summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordubslow <bunslow@gmail.com>2014-10-02 21:43:59 -0500
committerdubslow <bunslow@gmail.com>2014-10-02 21:43:59 -0500
commit5cde8a22f3de679ad97d683e389f418e5eccd98b (patch)
tree43afe1a1ca92d397d51f05e6b0a63e20a9fc9090
parent26d119a17b032830f4ba5063a4e5f9037a8240e9 (diff)
null terminate group messages (cause jfreegman can't str8 c)
-rw-r--r--toxcore/group.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/toxcore/group.c b/toxcore/group.c
index 96f5ba2f..cd524e4b 100644
--- a/toxcore/group.c
+++ b/toxcore/group.c
@@ -1267,10 +1267,13 @@ static void handle_message_packet_group(Group_Chats *g_c, int groupnumber, const
1267 case PACKET_ID_MESSAGE: { 1267 case PACKET_ID_MESSAGE: {
1268 if (msg_data_len == 0) 1268 if (msg_data_len == 0)
1269 return; 1269 return;
1270 uint8_t newmsg[msg_data_len+1];
1271 memcpy(newmsg, msg_data, msg_data_len);
1272 newmsg[msg_data_len] = 0;
1270 1273
1271 //TODO 1274 //TODO
1272 if (g_c->message_callback) 1275 if (g_c->message_callback)
1273 g_c->message_callback(g_c->m, groupnumber, index, msg_data, msg_data_len, g_c->message_callback_userdata); 1276 g_c->message_callback(g_c->m, groupnumber, index, newmsg, msg_data_len, g_c->message_callback_userdata);
1274 1277
1275 break; 1278 break;
1276 } 1279 }
@@ -1470,4 +1473,4 @@ uint32_t copy_chatlist(const Messenger *m, int *out_list, uint32_t list_size)
1470 1473
1471 return ret; 1474 return ret;
1472} 1475}
1473*/ \ No newline at end of file 1476*/