From: Arran Cudbard-Bell Date: Thu, 16 May 2024 05:18:38 +0000 (-0600) Subject: Add allowed chars merge function X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=45d541e1654522e98dae5f47a3e365714214f68b;p=thirdparty%2Ffreeradius-server.git Add allowed chars merge function --- diff --git a/src/lib/util/sbuff.h b/src/lib/util/sbuff.h index 5a2a09e2a7..7ee0f8296e 100644 --- a/src/lib/util/sbuff.h +++ b/src/lib/util/sbuff.h @@ -1419,6 +1419,15 @@ do { \ * * @{ */ + +/** Toggle any chars to 'true' in out, that were present in, out or in + * + */ +static inline void fr_sbuff_allowed_merge(bool out[static UINT8_MAX + 1], bool const in[static UINT8_MAX + 1]) +{ + for (size_t i = 0; i <= UINT8_MAX; i++) out[i] = out[i] || in[i]; +} + fr_sbuff_term_t *fr_sbuff_terminals_amerge(TALLOC_CTX *ctx, fr_sbuff_term_t const *a, fr_sbuff_term_t const *b);