summaryrefslogtreecommitdiff
path: root/src/libimcv/imv
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@corsac.net>2017-05-30 20:59:31 +0200
committerYves-Alexis Perez <corsac@corsac.net>2017-05-30 20:59:31 +0200
commitbba25e2ff6c4a193acb54560ea4417537bd2954e (patch)
tree9e074fe343f9ab6f5ce1e9c5142d9a6cf180fcda /src/libimcv/imv
parent05ddd767992d68bb38c7f16ece142e8c2e9ae016 (diff)
downloadvyos-strongswan-bba25e2ff6c4a193acb54560ea4417537bd2954e.tar.gz
vyos-strongswan-bba25e2ff6c4a193acb54560ea4417537bd2954e.zip
New upstream version 5.5.3
Diffstat (limited to 'src/libimcv/imv')
-rw-r--r--src/libimcv/imv/imv_agent.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/libimcv/imv/imv_agent.c b/src/libimcv/imv/imv_agent.c
index d0508624d..e96faa77e 100644
--- a/src/libimcv/imv/imv_agent.c
+++ b/src/libimcv/imv/imv_agent.c
@@ -626,22 +626,13 @@ typedef struct {
} language_enumerator_t;
-/**
- * Implementation of language_enumerator.destroy.
- */
-static void language_enumerator_destroy(language_enumerator_t *this)
-{
- free(this);
-}
-
-/**
- * Implementation of language_enumerator.enumerate
- */
-static bool language_enumerator_enumerate(language_enumerator_t *this, ...)
+METHOD(enumerator_t, language_enumerator_enumerate, bool,
+ language_enumerator_t *this, va_list args)
{
char *pos, *cur_lang, **lang;
TNC_UInt32 len;
- va_list args;
+
+ VA_ARGS_VGET(args, lang);
if (!this->lang_len)
{
@@ -676,11 +667,7 @@ static bool language_enumerator_enumerate(language_enumerator_t *this, ...)
}
cur_lang[len] = '\0';
- va_start(args, this);
- lang = va_arg(args, char**);
*lang = cur_lang;
- va_end(args);
-
return TRUE;
}
@@ -689,10 +676,13 @@ METHOD(imv_agent_t, create_language_enumerator, enumerator_t*,
{
language_enumerator_t *e;
- /* Create a language enumerator instance */
- e = malloc_thing(language_enumerator_t);
- e->public.enumerate = (void*)language_enumerator_enumerate;
- e->public.destroy = (void*)language_enumerator_destroy;
+ INIT(e,
+ .public = {
+ .enumerate = enumerator_enumerate_default,
+ .venumerate = _language_enumerator_enumerate,
+ .destroy = (void*)free,
+ },
+ );
if (!this->get_attribute ||
!this->get_attribute(this->id, state->get_connection_id(state),