summaryrefslogtreecommitdiff
path: root/toxcore/group.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/group.c')
-rw-r--r--toxcore/group.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/toxcore/group.c b/toxcore/group.c
index 26df82bd..24f0b72e 100644
--- a/toxcore/group.c
+++ b/toxcore/group.c
@@ -190,7 +190,7 @@ static int get_peer_index(Group_c *g, uint16_t peer_number)
190 190
191static uint16_t calculate_comp_value(const uint8_t *pk1, const uint8_t *pk2) 191static uint16_t calculate_comp_value(const uint8_t *pk1, const uint8_t *pk2)
192{ 192{
193 uint8_t cmp1, cmp2; 193 uint8_t cmp1, cmp2 = 0;
194 194
195 for (cmp1 = crypto_box_PUBLICKEYBYTES; cmp1 != 0; --cmp1) { 195 for (cmp1 = crypto_box_PUBLICKEYBYTES; cmp1 != 0; --cmp1) {
196 uint8_t index = crypto_box_PUBLICKEYBYTES - cmp1; 196 uint8_t index = crypto_box_PUBLICKEYBYTES - cmp1;
@@ -1025,7 +1025,7 @@ static void handle_friend_invite_packet(Messenger *m, int32_t friendnumber, cons
1025 return; 1025 return;
1026 1026
1027 uint16_t peer_number = rand(); /* TODO: what if two people enter the group at the same time and 1027 uint16_t peer_number = rand(); /* TODO: what if two people enter the group at the same time and
1028 are given the same peer_number by different nodes? */ 1028 are given the same peer_number by different nodes? */
1029 unsigned int tries = 0; 1029 unsigned int tries = 0;
1030 1030
1031 while (get_peer_index(g, peer_number) != -1) { 1031 while (get_peer_index(g, peer_number) != -1) {
@@ -1282,6 +1282,8 @@ static void handle_direct_packet(Group_Chats *g_c, int groupnumber, const uint8_
1282 } 1282 }
1283 } 1283 }
1284 1284
1285 break;
1286
1285 case PEER_QUERY_ID: { 1287 case PEER_QUERY_ID: {
1286 Group_c *g = get_group_c(g_c, groupnumber); 1288 Group_c *g = get_group_c(g_c, groupnumber);
1287 1289