From dbdc0decd4475be453f7ab2bcf74a2bbde1e2460 Mon Sep 17 00:00:00 2001 From: Vedran Ljubovic Date: Sat, 26 Aug 2006 17:07:23 +0000 Subject: [PATCH] It seems that use of twstrim is dangerous after all... --- edelib2/Config.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/edelib2/Config.cpp b/edelib2/Config.cpp index 6a1a123..ede2b78 100755 --- a/edelib2/Config.cpp +++ b/edelib2/Config.cpp @@ -813,7 +813,10 @@ void Config_Section::add_entry(const char* key, const char* value) if(!value) return; char *kvpair; - asprintf(&kvpair,"%s=%s",twstrim(key),twstrim(value)); + char *m_key = wstrim(strdup(key)); + char *m_value = wstrim(strdup(value)); + asprintf(&kvpair,"%s=%s",m_key,m_value); + free (m_key); free (m_value); // if key already exists, delete bool found = false;