diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-03 17:29:13 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-03 17:29:13 +0200 |
commit | e40e5bfcd40be2bbdce8a00066709bcf85b8c79c (patch) | |
tree | ef4d9a5b31ff6c960a855248a56f12c9e532c2e7 /src | |
parent | f50af5edddee3a5d7d353b3829829c00a16890cc (diff) | |
download | gnunet-e40e5bfcd40be2bbdce8a00066709bcf85b8c79c.tar.gz gnunet-e40e5bfcd40be2bbdce8a00066709bcf85b8c79c.zip |
bad sizeof
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_common.h | 2 | ||||
-rw-r--r-- | src/util/mq.c | 6 | ||||
-rw-r--r-- | 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, | |||
1151 | * @return 0 if a is zero, non-zero otherwise | 1151 | * @return 0 if a is zero, non-zero otherwise |
1152 | */ | 1152 | */ |
1153 | #define GNUNET_is_zero(a) \ | 1153 | #define GNUNET_is_zero(a) \ |
1154 | GNUNET_is_zero_ (a, sizeof (a)) | 1154 | GNUNET_is_zero_ (a, sizeof (*a)) |
1155 | 1155 | ||
1156 | 1156 | ||
1157 | /** | 1157 | /** |
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: | |||
297 | * @param error the error type | 297 | * @param error the error type |
298 | */ | 298 | */ |
299 | void | 299 | void |
300 | GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, enum GNUNET_MQ_Error error) | 300 | GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, |
301 | enum GNUNET_MQ_Error error) | ||
301 | { | 302 | { |
302 | if (NULL == mq->error_handler) | 303 | if (NULL == mq->error_handler) |
303 | { | 304 | { |
@@ -306,7 +307,8 @@ GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, enum GNUNET_MQ_Error error) | |||
306 | (int) error); | 307 | (int) error); |
307 | return; | 308 | return; |
308 | } | 309 | } |
309 | mq->error_handler (mq->error_handler_cls, error); | 310 | mq->error_handler (mq->error_handler_cls, |
311 | error); | ||
310 | } | 312 | } |
311 | 313 | ||
312 | 314 | ||
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, | |||
468 | const struct in6_addr *ip) | 468 | const struct in6_addr *ip) |
469 | { | 469 | { |
470 | unsigned int i; | 470 | unsigned int i; |
471 | unsigned int j; | ||
472 | 471 | ||
473 | if (NULL == list) | 472 | if (NULL == list) |
474 | return GNUNET_NO; | 473 | return GNUNET_NO; |
@@ -476,7 +475,7 @@ check_ipv6_listed (const struct GNUNET_STRINGS_IPv6NetworkPolicy *list, | |||
476 | NEXT: | 475 | NEXT: |
477 | while (0 != GNUNET_is_zero (&list[i].network)) | 476 | while (0 != GNUNET_is_zero (&list[i].network)) |
478 | { | 477 | { |
479 | for (j = 0; j < sizeof(struct in6_addr) / sizeof(int); j++) | 478 | for (unsigned int j = 0; j < sizeof(struct in6_addr) / sizeof(int); j++) |
480 | if (((((int *) ip)[j] & ((int *) &list[i].netmask)[j])) != | 479 | if (((((int *) ip)[j] & ((int *) &list[i].netmask)[j])) != |
481 | (((int *) &list[i].network)[j] & ((int *) &list[i].netmask)[j])) | 480 | (((int *) &list[i].network)[j] & ((int *) &list[i].netmask)[j])) |
482 | { | 481 | { |