From: Arran Cudbard-Bell Date: Wed, 1 Dec 2021 14:32:11 +0000 (-0600) Subject: Minor formatting issues in xlat_tokenize.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33eb7276883eccc5019216b63938f78a013ec7cd;p=thirdparty%2Ffreeradius-server.git Minor formatting issues in xlat_tokenize.c --- diff --git a/src/lib/unlang/xlat_tokenize.c b/src/lib/unlang/xlat_tokenize.c index 7e0bb053e3b..c0976bb4b0c 100644 --- a/src/lib/unlang/xlat_tokenize.c +++ b/src/lib/unlang/xlat_tokenize.c @@ -20,9 +20,9 @@ * @file xlat_tokenize.c * @brief String expansion ("translation"). Tokenizes xlat expansion strings. * + * @copyright 2017-2021 Arran Cudbard-Bell (a.cudbardb@freeradius.org) * @copyright 2000 Alan DeKok (aland@freeradius.org) * @copyright 2000,2006 The FreeRADIUS server project - * @copyright 2017-2020 Arran Cudbard-Bell (a.cudbardb@freeradius.org) */ RCSID("$Id$") @@ -124,7 +124,6 @@ static inline CC_HINT(always_inline) xlat_exp_t *xlat_exp_alloc_null(TALLOC_CTX return node; } - /** Allocate an xlat node * * @param[in] ctx to allocate node in. @@ -144,9 +143,13 @@ static inline CC_HINT(always_inline) xlat_exp_t *xlat_exp_alloc(TALLOC_CTX *ctx, if (!in) return node; node->fmt = talloc_bstrndup(node, in, inlen); - - if (type == XLAT_BOX) { + switch (type) { + case XLAT_BOX: fr_value_box_strdup_shallow(&node->data, NULL, node->fmt, false); + break; + + default: + break; } return node; @@ -1738,9 +1741,7 @@ int xlat_resolve(xlat_exp_t **head, xlat_flags_t *flags, xlat_res_rules_t const */ case XLAT_VIRTUAL_UNRESOLVED: { - if (xlat_resolve_virtual_attribute(node, node->attr) == 0) { - break; - } + if (xlat_resolve_virtual_attribute(node, node->attr) == 0) break; /* * Try and resolve (in-place) as an attribute