From 6d815ac688b4517d3d877f9feee428849ae65f6d Mon Sep 17 00:00:00 2001 From: TingPing Date: Wed, 12 Feb 2014 09:27:28 -0500 Subject: Fix warning --- src/common/cfgfiles.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 68f4126e..47cc9677 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -722,16 +722,16 @@ get_default_spell_languages (void) g_free(last); if (lang_list[0]) - return ret; + return g_strdup (ret); } - return "en"; + return g_strdup ("en"); } void load_default_config(void) { - const char *username, *realname, *font; + const char *username, *realname, *font, *langs; char *sp; #ifdef WIN32 char out[256]; @@ -905,7 +905,8 @@ load_default_config(void) } strcpy (prefs.hex_text_font_alternative, DEF_FONT_ALTER); - strcpy (prefs.hex_text_spell_langs, get_default_spell_languages ()); + langs = get_default_spell_languages (); + strcpy (prefs.hex_text_spell_langs, langs); /* private variables */ @@ -917,6 +918,7 @@ load_default_config(void) g_free ((char *)username); g_free ((char *)realname); + g_free ((char *)langs); } int -- cgit 1.4.1