diff options
author | Tobias Brunner <tobias@strongswan.org> | 2010-03-08 15:26:09 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2010-03-08 15:34:38 +0100 |
commit | d543d9cadfd69c01eff883cb2bab927d6a3c1564 (patch) | |
tree | e0fcd2a17db2388a0a79dab92a3218fe67d88d66 /src/libstrongswan/plugins/plugin_loader.c | |
parent | d14203b00954e828883fed0ddcc890d1ff1e02fd (diff) | |
download | strongswan-d543d9cadfd69c01eff883cb2bab927d6a3c1564.tar.bz2 strongswan-d543d9cadfd69c01eff883cb2bab927d6a3c1564.tar.xz |
Adding a helper function that translates single characters in a string.
Diffstat (limited to 'src/libstrongswan/plugins/plugin_loader.c')
-rw-r--r-- | src/libstrongswan/plugins/plugin_loader.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/libstrongswan/plugins/plugin_loader.c b/src/libstrongswan/plugins/plugin_loader.c index 5dfeb873f..abcb84440 100644 --- a/src/libstrongswan/plugins/plugin_loader.c +++ b/src/libstrongswan/plugins/plugin_loader.c @@ -50,23 +50,6 @@ struct private_plugin_loader_t { linked_list_t *names; }; -/** - * Replace '-' with '_' to use str as identifier. - */ -static char* sanitize(char *str) -{ - char *pos = str; - while (pos && *pos) - { - if (*pos == '-') - { - *pos = '_'; - } - pos++; - } - return str; -} - #ifdef MONOLITHIC /** * load a single plugin in monolithic mode @@ -83,7 +66,7 @@ static plugin_t* load_plugin(private_plugin_loader_t *this, { return NULL; } - sanitize(create); + translate(create, "-", "_"); constructor = dlsym(RTLD_DEFAULT, create); if (constructor == NULL) { @@ -120,7 +103,7 @@ static plugin_t* load_plugin(private_plugin_loader_t *this, { return NULL; } - sanitize(create); + translate(create, "-", "_"); if (lib->integrity) { if (!lib->integrity->check_file(lib->integrity, name, file)) |