* Will be declared in the scope of the loop.
*/
#define talloc_foreach(_array, _iter) \
- for (__typeof__(_array[0]) _iter, *_p = (void *)(_array), *_end = (void *)((_array) + talloc_array_length(_array)); \
+ for (__typeof__(_array[0]) _iter, *_p = (void *)(_array), *_end = _array ? (void *)((_array) + talloc_array_length(_array)) : NULL; \
(_p < _end) && (_iter = *((void **)(uintptr_t)(_p))); \
_p = (__typeof__(_p))((__typeof__(_array))_p) + 1)
* Loop over the lua functions, registering an xlat
* that'll call that function specifically.
*/
- if (!inst->lua.funcs) return 0;
talloc_foreach(inst->lua.funcs, func) {
name = talloc_asprintf(NULL, "%s.%s", mctx->inst->name, func->name);
if (unlikely((xlat = xlat_func_register_module(inst, mctx, name, redis_lua_func_xlat, FR_TYPE_VOID)) == NULL)) return -1;