diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-08-01 19:36:38 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-08-01 19:36:38 +0000 |
commit | 69099d84949a8044fdfc74e9d7ff6b9e57fc0bcd (patch) | |
tree | 9c97923869ff4f56717d7e0ac97c8588f816c798 /src/libwpactrl/wpactrl_update.c | |
parent | 22a1dc61ef8e4e1c98e3a088db1dbc84d424c7a7 (diff) | |
download | bcnm-69099d84949a8044fdfc74e9d7ff6b9e57fc0bcd.tar.xz |
Flesh out libwpactrl
Diffstat (limited to 'src/libwpactrl/wpactrl_update.c')
-rw-r--r-- | src/libwpactrl/wpactrl_update.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/libwpactrl/wpactrl_update.c b/src/libwpactrl/wpactrl_update.c index 0462cbe..e5d8db1 100644 --- a/src/libwpactrl/wpactrl_update.c +++ b/src/libwpactrl/wpactrl_update.c @@ -8,18 +8,6 @@ #include <bcnm/wpactrl.h> #include "wpactrl-internal.h" -static inline int filter_search (char const *s, size_t len, char const *filters, size_t filterlen) -{ - while (filterlen) - { - size_t flen = strlen(filters) ; - if (len >= flen && !strncmp(filters, s, flen)) return 1 ; - filters += flen+1 ; - filterlen -= flen+1 ; - } - return 0 ; -} - static inline int validate (char const *s, size_t len) { if (len < 4) return 0 ; @@ -41,7 +29,7 @@ int wpactrl_update (wpactrl_t *a) if (r < 0) return -1 ; if (!r) break ; if (a->options & WPACTRL_OPTION_NOFILTER - || (validate(buf, r) && filter_search(buf, r, a->filters.s, a->filters.len))) + || (validate(buf, r) && wpactrl_filter_match(a, buf, r))) { buf[r] = 0 ; if (!stralloc_catb(&a->data, buf, r+1)) return -1 ; |