gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: bad sizeof


From: gnunet
Subject: [gnunet] branch master updated: bad sizeof
Date: Fri, 03 Apr 2020 17:33:48 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new e40e5bfcd bad sizeof
e40e5bfcd is described below

commit e40e5bfcd40be2bbdce8a00066709bcf85b8c79c
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Apr 3 17:29:13 2020 +0200

    bad sizeof
---
 src/include/gnunet_common.h | 2 +-
 src/util/mq.c               | 6 ++++--
 src/util/service.c          | 3 +--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 76c2b9352..86d1a9f37 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -1151,7 +1151,7 @@ GNUNET_is_zero_ (const void *a,
  * @return 0 if a is zero, non-zero otherwise
  */
 #define GNUNET_is_zero(a)           \
-  GNUNET_is_zero_ (a, sizeof (a))
+  GNUNET_is_zero_ (a, sizeof (*a))
 
 
 /**
diff --git a/src/util/mq.c b/src/util/mq.c
index 003e0955d..78dc7dba2 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -297,7 +297,8 @@ done:
  * @param error the error type
  */
 void
-GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, enum GNUNET_MQ_Error 
error)
+GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq,
+                        enum GNUNET_MQ_Error error)
 {
   if (NULL == mq->error_handler)
   {
@@ -306,7 +307,8 @@ GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, enum 
GNUNET_MQ_Error error)
          (int) error);
     return;
   }
-  mq->error_handler (mq->error_handler_cls, error);
+  mq->error_handler (mq->error_handler_cls,
+                     error);
 }
 
 
diff --git a/src/util/service.c b/src/util/service.c
index 999a9e017..9dc14eba9 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -468,7 +468,6 @@ check_ipv6_listed (const struct 
GNUNET_STRINGS_IPv6NetworkPolicy *list,
                    const struct in6_addr *ip)
 {
   unsigned int i;
-  unsigned int j;
 
   if (NULL == list)
     return GNUNET_NO;
@@ -476,7 +475,7 @@ check_ipv6_listed (const struct 
GNUNET_STRINGS_IPv6NetworkPolicy *list,
 NEXT:
   while (0 != GNUNET_is_zero (&list[i].network))
   {
-    for (j = 0; j < sizeof(struct in6_addr) / sizeof(int); j++)
+    for (unsigned int j = 0; j < sizeof(struct in6_addr) / sizeof(int); j++)
       if (((((int *) ip)[j] & ((int *) &list[i].netmask)[j])) !=
           (((int *) &list[i].network)[j] & ((int *) &list[i].netmask)[j]))
       {

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]