aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/common_allocation.c8
-rw-r--r--src/util/service.c2
-rw-r--r--src/util/test_peer.c3
3 files changed, 6 insertions, 7 deletions
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c
index 4aad49777..a404a1627 100644
--- a/src/util/common_allocation.c
+++ b/src/util/common_allocation.c
@@ -538,9 +538,9 @@ GNUNET_copy_message (const struct GNUNET_MessageHeader *msg)
538 * @param a pointer to @a n bytes which should be tested for the 538 * @param a pointer to @a n bytes which should be tested for the
539 * entire memory being zero'ed out. 539 * entire memory being zero'ed out.
540 * @param n number of bytes in @a to be tested 540 * @param n number of bytes in @a to be tested
541 * @return 0 if a is zero, non-zero otherwise 541 * @return GNUNET_YES if a is zero, GNUNET_NO otherwise
542 */ 542 */
543int 543enum GNUNET_GenericReturnValue
544GNUNET_is_zero_ (const void *a, 544GNUNET_is_zero_ (const void *a,
545 size_t n) 545 size_t n)
546{ 546{
@@ -548,8 +548,8 @@ GNUNET_is_zero_ (const void *a,
548 548
549 for (size_t i = 0; i < n; i++) 549 for (size_t i = 0; i < n; i++)
550 if (b[i]) 550 if (b[i])
551 return 1; 551 return GNUNET_NO;
552 return 0; 552 return GNUNET_YES;
553} 553}
554 554
555 555
diff --git a/src/util/service.c b/src/util/service.c
index e6bbe855f..ddd31181d 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -473,7 +473,7 @@ check_ipv6_listed (const struct GNUNET_STRINGS_IPv6NetworkPolicy *list,
473 return GNUNET_NO; 473 return GNUNET_NO;
474 i = 0; 474 i = 0;
475NEXT: 475NEXT:
476 while (0 != GNUNET_is_zero (&list[i].network)) 476 while (GNUNET_NO == GNUNET_is_zero (&list[i].network))
477 { 477 {
478 for (unsigned int j = 0; j < sizeof(struct in6_addr) / sizeof(int); j++) 478 for (unsigned int j = 0; j < sizeof(struct in6_addr) / sizeof(int); j++)
479 if (((((int *) ip)[j] & ((int *) &list[i].netmask)[j])) != 479 if (((((int *) ip)[j] & ((int *) &list[i].netmask)[j])) !=
diff --git a/src/util/test_peer.c b/src/util/test_peer.c
index 320746c76..bb0bc48dc 100644
--- a/src/util/test_peer.c
+++ b/src/util/test_peer.c
@@ -106,8 +106,7 @@ check ()
106 * is expected to be set to zero 106 * is expected to be set to zero
107 */GNUNET_log_skip (1, GNUNET_YES); 107 */GNUNET_log_skip (1, GNUNET_YES);
108 GNUNET_PEER_resolve (0, &res); 108 GNUNET_PEER_resolve (0, &res);
109 GNUNET_assert (0 == 109 GNUNET_assert (GNUNET_YES == GNUNET_is_zero (&res));
110 GNUNET_is_zero (&res));
111 110
112 /* Removing peer entries 1 and 3 from table using the list decrement function */ 111 /* Removing peer entries 1 and 3 from table using the list decrement function */
113 /* If count = 0, nothing should be done whatsoever */ 112 /* If count = 0, nothing should be done whatsoever */