aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2019-04-26 05:56:54 +0200
committerJulius Bünger <buenger@mytum.de>2019-04-26 05:56:54 +0200
commitf5f5a9f680df2cebe6435ec87650cb3cb6e3ef6e (patch)
tree94055d2c049a65b5ab6c61fd3c5867fe49f6f429 /src/peerinfo
parenta097690795f4f814de7cdbc97ef95fb899eeacd3 (diff)
downloadgnunet-f5f5a9f680df2cebe6435ec87650cb3cb6e3ef6e.tar.gz
gnunet-f5f5a9f680df2cebe6435ec87650cb3cb6e3ef6e.zip
memcmp() -> GNUNET_memcmp(), first take
Diffstat (limited to 'src/peerinfo')
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c7
-rw-r--r--src/peerinfo/peerinfo_api.c10
-rw-r--r--src/peerinfo/test_peerinfo_api_notify_friend_only.c4
3 files changed, 9 insertions, 12 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index 75e99d1f8..61fdd0f24 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -584,9 +584,8 @@ hosts_directory_scan_callback (void *cls,
584 584
585 if ( (NULL != r.hello) && 585 if ( (NULL != r.hello) &&
586 (NULL != r.friend_only_hello) && 586 (NULL != r.friend_only_hello) &&
587 (0 != memcmp (&id_friend, 587 (0 != GNUNET_memcmp (&id_friend,
588 &id_public, 588 &id_public)) )
589 sizeof (id_friend))) )
590 { 589 {
591 /* HELLOs are not for the same peer */ 590 /* HELLOs are not for the same peer */
592 GNUNET_break (0); 591 GNUNET_break (0);
@@ -599,7 +598,7 @@ hosts_directory_scan_callback (void *cls,
599 strlen (filename), 598 strlen (filename),
600 &identity.public_key)) 599 &identity.public_key))
601 { 600 {
602 if (0 != memcmp (&id, &identity, sizeof (id_friend))) 601 if (0 != GNUNET_memcmp (&id, &identity))
603 { 602 {
604 /* HELLOs are not for the same peer */ 603 /* HELLOs are not for the same peer */
605 GNUNET_break (0); 604 GNUNET_break (0);
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index 4b56b34c7..485b5e183 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -271,9 +271,8 @@ check_info (void *cls,
271 return GNUNET_SYSERR; 271 return GNUNET_SYSERR;
272 } 272 }
273 if ( (GNUNET_YES == ic->have_peer) && 273 if ( (GNUNET_YES == ic->have_peer) &&
274 (0 != memcmp (&ic->peer, 274 (0 != GNUNET_memcmp (&ic->peer,
275 &im->peer, 275 &im->peer)) )
276 sizeof (struct GNUNET_PeerIdentity))) )
277 { 276 {
278 /* bogus message (from a different iteration call?); out of sequence! */ 277 /* bogus message (from a different iteration call?); out of sequence! */
279 LOG (GNUNET_ERROR_TYPE_ERROR, 278 LOG (GNUNET_ERROR_TYPE_ERROR,
@@ -303,9 +302,8 @@ check_info (void *cls,
303 GNUNET_break (0); 302 GNUNET_break (0);
304 return GNUNET_SYSERR; 303 return GNUNET_SYSERR;
305 } 304 }
306 if (0 != memcmp (&im->peer, 305 if (0 != GNUNET_memcmp (&im->peer,
307 &id, 306 &id))
308 sizeof (struct GNUNET_PeerIdentity)))
309 { 307 {
310 /* malformed message */ 308 /* malformed message */
311 GNUNET_break (0); 309 GNUNET_break (0);
diff --git a/src/peerinfo/test_peerinfo_api_notify_friend_only.c b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
index 50118f8bb..0a9bfc083 100644
--- a/src/peerinfo/test_peerinfo_api_notify_friend_only.c
+++ b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
@@ -160,7 +160,7 @@ process_w_fo (void *cls,
160 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n", 160 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n",
161 (GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public", 161 (GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public",
162 GNUNET_i2s (peer)); 162 GNUNET_i2s (peer));
163 if (0 == memcmp (&pid, peer, sizeof(pid))) 163 if (0 == GNUNET_memcmp (&pid, peer))
164 { 164 {
165 res_cb_w_fo = GNUNET_YES; 165 res_cb_w_fo = GNUNET_YES;
166 GNUNET_SCHEDULER_add_now (&done, NULL); 166 GNUNET_SCHEDULER_add_now (&done, NULL);
@@ -199,7 +199,7 @@ process_wo_fo (void *cls, const struct GNUNET_PeerIdentity *peer,
199 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n", 199 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Received %s HELLO for peer `%s'\n",
200 (GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public", 200 (GNUNET_YES == GNUNET_HELLO_is_friend_only (hello)) ? "friend only" : "public",
201 GNUNET_i2s (peer)); 201 GNUNET_i2s (peer));
202 if (0 == memcmp (&pid, peer, sizeof(pid))) 202 if (0 == GNUNET_memcmp (&pid, peer))
203 { 203 {
204 GNUNET_break(0); 204 GNUNET_break(0);
205 res_cb_wo_fo = GNUNET_YES; 205 res_cb_wo_fo = GNUNET_YES;