diff options
Diffstat (limited to 'lib/utils')
| -rw-r--r-- | lib/utils/Makefile.am | 1 | ||||
| -rw-r--r-- | lib/utils/Plugin.cpp | 15 | ||||
| -rw-r--r-- | lib/utils/overlapping_strcpy.c | 22 |
3 files changed, 23 insertions, 15 deletions
diff --git a/lib/utils/Makefile.am b/lib/utils/Makefile.am index 129feeb5..37508ee7 100644 --- a/lib/utils/Makefile.am +++ b/lib/utils/Makefile.am @@ -16,6 +16,7 @@ libABRTUtils_la_SOURCES = \ xfuncs.c \ concat_path_file.c \ append_to_malloced_string.c \ + overlapping_strcpy.c \ encbase64.c \ stdio_helpers.c \ hash_md5.c hash_md5.h \ diff --git a/lib/utils/Plugin.cpp b/lib/utils/Plugin.cpp index 8c00e609..bf237959 100644 --- a/lib/utils/Plugin.cpp +++ b/lib/utils/Plugin.cpp @@ -40,21 +40,6 @@ void CPlugin::SetSettings(const map_plugin_settings_t& pSettings) } } -const map_plugin_settings_t& CPlugin::GetSettings() -{ - VERB3 - { - log("GetSettings:"); - map_plugin_settings_t::const_iterator it = m_pSettings.begin(); - while (it != m_pSettings.end()) - { - log(" settings[%s]:'%s'", it->first.c_str(), it->second.c_str()); - it++; - } - } - return m_pSettings; -} - bool LoadPluginSettings(const char *pPath, map_plugin_settings_t& pSettings, bool skipKeysWithoutValue /*= true*/) { diff --git a/lib/utils/overlapping_strcpy.c b/lib/utils/overlapping_strcpy.c new file mode 100644 index 00000000..41c1c1a1 --- /dev/null +++ b/lib/utils/overlapping_strcpy.c @@ -0,0 +1,22 @@ +/* + * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> + * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + */ +#include "abrtlib.h" + +/* Like strcpy but can copy overlapping strings. */ +void overlapping_strcpy(char *dst, const char *src) +{ + /* Cheap optimization for dst == src case - + * better to have it here than in many callers. + */ + if (dst != src) + { + while ((*dst = *src) != '\0') + { + dst++; + src++; + } + } +} |
