summaryrefslogtreecommitdiff
path: root/toxcore/friend_requests.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-10-28 16:01:29 -0400
committerirungentoo <irungentoo@gmail.com>2013-10-28 16:01:29 -0400
commit415835ce3d2daa9ecd4100e76d58d93b3afa2db0 (patch)
tree755d041ea06a9b1c05fc72687c9dd5c6e98bbe73 /toxcore/friend_requests.c
parent988922bdeb94dd83e61ed387b29187ac4c9936e0 (diff)
parent2bdce934373d238778bc77a04198bd3f1481542f (diff)
Merge branch 'master' into harden
Also removed some old, useless loading code.
Diffstat (limited to 'toxcore/friend_requests.c')
-rw-r--r--toxcore/friend_requests.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toxcore/friend_requests.c b/toxcore/friend_requests.c
index c821d998..67977c23 100644
--- a/toxcore/friend_requests.c
+++ b/toxcore/friend_requests.c
@@ -26,6 +26,7 @@
26#endif 26#endif
27 27
28#include "friend_requests.h" 28#include "friend_requests.h"
29#include "util.h"
29 30
30/* Try to send a friend request to peer with public_key. 31/* Try to send a friend request to peer with public_key.
31 * data is the data in the request and length is the length. 32 * data is the data in the request and length is the length.
@@ -102,7 +103,7 @@ static void addto_receivedlist(Friend_Requests *fr, uint8_t *client_id)
102 if (fr->received_requests_index >= MAX_RECEIVED_STORED) 103 if (fr->received_requests_index >= MAX_RECEIVED_STORED)
103 fr->received_requests_index = 0; 104 fr->received_requests_index = 0;
104 105
105 memcpy(fr->received_requests[fr->received_requests_index], client_id, crypto_box_PUBLICKEYBYTES); 106 id_copy(fr->received_requests[fr->received_requests_index], client_id);
106 ++fr->received_requests_index; 107 ++fr->received_requests_index;
107} 108}
108 109
@@ -115,10 +116,9 @@ static int request_received(Friend_Requests *fr, uint8_t *client_id)
115{ 116{
116 uint32_t i; 117 uint32_t i;
117 118
118 for (i = 0; i < MAX_RECEIVED_STORED; ++i) { 119 for (i = 0; i < MAX_RECEIVED_STORED; ++i)
119 if (memcmp(fr->received_requests[i], client_id, crypto_box_PUBLICKEYBYTES) == 0) 120 if (id_equal(fr->received_requests[i], client_id))
120 return 1; 121 return 1;
121 }
122 122
123 return 0; 123 return 0;
124} 124}