diff options
Diffstat (limited to 'src/extensions')
-rw-r--r-- | src/extensions/extension_age_restriction.c | 2 | ||||
-rw-r--r-- | src/extensions/extensions.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/extensions/extension_age_restriction.c b/src/extensions/extension_age_restriction.c index 9acc5dcbf..fedf12d44 100644 --- a/src/extensions/extension_age_restriction.c +++ b/src/extensions/extension_age_restriction.c @@ -79,7 +79,7 @@ TALER_parse_age_group_string ( return GNUNET_SYSERR; } - if (0>val || 32<=val || prev>=val) + if (32<=val || prev>=val) return GNUNET_SYSERR; mask->bits |= (1 << val); diff --git a/src/extensions/extensions.c b/src/extensions/extensions.c index 55a7dcd81..0df0bae36 100644 --- a/src/extensions/extensions.c +++ b/src/extensions/extensions.c @@ -38,7 +38,7 @@ TALER_extensions_get_head () enum GNUNET_GenericReturnValue TALER_extensions_add ( - const struct TALER_Extension *extension) + struct TALER_Extension *extension) { /* Sanity checks */ if ((NULL == extension) || @@ -60,10 +60,12 @@ TALER_extensions_add ( else { struct TALER_Extension *iter; + struct TALER_Extension *last; /* Check for collisions */ for (iter = TE_extensions; NULL != iter; iter = iter->next) { + last = iter; if (extension->type == iter->type || 0 == strcasecmp (extension->name, iter->name)) @@ -76,7 +78,7 @@ TALER_extensions_add ( } /* No collisions found, so add this extension to the list */ - iter->next = (struct TALER_Extension *) extension; + last->next = extension; } return GNUNET_OK; |