]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use macro instead of hand-rolled loop
authorAlan T. DeKok <aland@freeradius.org>
Sun, 26 Jul 2026 14:27:40 +0000 (10:27 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 26 Jul 2026 15:44:54 +0000 (11:44 -0400)
src/lib/unlang/compile.c

index 67ef3cc3283fbcc1e66da0e12c2f98d037c93141..eb2b5124bc13824c6eafbdc21780a66d51718217 100644 (file)
@@ -1595,11 +1595,7 @@ static unlang_t *compile_tmpl(unlang_t *parent, unlang_compile_ctx_t *unlang_ctx
  */
 bool unlang_compile_limit_subsection(CONF_SECTION *cs, char const *name)
 {
-       CONF_ITEM *ci;
-
-       for (ci=cf_item_next(cs, NULL);
-            ci != NULL;
-            ci=cf_item_next(cs, ci)) {
+       cf_item_foreach(cs, ci) {
                /*
                 *      If we're a redundant, etc. group, then the
                 *      intention is to call modules, rather than
@@ -1627,6 +1623,9 @@ bool unlang_compile_limit_subsection(CONF_SECTION *cs, char const *name)
                        continue;
                }
 
+               /*
+                *      Allow a module as a child.
+                */
                if (cf_item_is_pair(ci)) {
                        CONF_PAIR *cp = cf_item_to_pair(ci);