summaryrefslogtreecommitdiffstats
path: root/src/daemon
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-01-11 18:53:22 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-01-11 18:53:22 +0100
commite7fde9b01293d7bfdfe644b73f8ac679211d0b08 (patch)
treed772f47e525baedadba3517ff59d2782953cce2c /src/daemon
parentf4dcdc9a1ee5971bfda6acf079d615a6f40382b1 (diff)
downloadabrt-e7fde9b01293d7bfdfe644b73f8ac679211d0b08.tar.gz
abrt-e7fde9b01293d7bfdfe644b73f8ac679211d0b08.tar.xz
abrt-e7fde9b01293d7bfdfe644b73f8ac679211d0b08.zip
remove C++-ism ssprintf from abrtlib.h
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/PluginManager.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/daemon/PluginManager.cpp b/src/daemon/PluginManager.cpp
index 161256c5..e6059583 100644
--- a/src/daemon/PluginManager.cpp
+++ b/src/daemon/PluginManager.cpp
@@ -131,10 +131,11 @@ CPlugin* CPluginManager::LoadPlugin(const char *pName, bool enabled_only)
/* Kerneloops{,Scanner,Reporter} share the same .conf file */
conf_name = "Kerneloops";
}
- string conf_fullname = ssprintf(PLUGINS_CONF_DIR"/%s."PLUGINS_CONF_EXTENSION, conf_name);
+ char *conf_fullname = xasprintf(PLUGINS_CONF_DIR"/%s."PLUGINS_CONF_EXTENSION, conf_name);
map_string_h *pluginSettings = new_map_string();
- if (load_conf_file(conf_fullname.c_str(), pluginSettings, /*skip key w/o values:*/ true))
+ if (load_conf_file(conf_fullname, pluginSettings, /*skip key w/o values:*/ true))
VERB3 log("Loaded %s.conf", conf_name);
+ free(conf_fullname);
if (enabled_only)
{
@@ -154,14 +155,16 @@ CPlugin* CPluginManager::LoadPlugin(const char *pName, bool enabled_only)
}
}
- string libPath = ssprintf(PLUGINS_LIB_DIR"/"PLUGINS_LIB_PREFIX"%s."PLUGINS_LIB_EXTENSION, pName);
- void *handle = dlopen(libPath.c_str(), RTLD_NOW);
+ char *libPath = xasprintf(PLUGINS_LIB_DIR"/"PLUGINS_LIB_PREFIX"%s."PLUGINS_LIB_EXTENSION, pName);
+ void *handle = dlopen(libPath, RTLD_NOW);
if (!handle)
{
- error_msg("Can't load '%s': %s", libPath.c_str(), dlerror());
+ error_msg("Can't load '%s': %s", libPath, dlerror());
+ free(libPath);
free_map_string(pluginSettings);
return NULL; /* error */
}
+ free(libPath);
CLoadedModule *module = new CLoadedModule(handle, pName);
if (module->GetMagicNumber() != PLUGINS_MAGIC_NUMBER
|| module->GetType() < 0