[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Xgnokii problems
From: |
Daniele Forsi |
Subject: |
Re: Xgnokii problems |
Date: |
Tue, 25 Jan 2005 00:14:04 +0100 |
User-agent: |
KMail/1.4.3 |
Pawel Kot wrote:
> Thanks for spotting. What about this:
ok (I didn't like the "return" I proposed), but there is a double memory free
when pos is NULL: in this case the program always enters the second
if (!LocaleHelpExists(xgnokiiConfig.help_locale))
because xgnokiiConfig.help_locale is unchanged
this patch is against your patched xgnoki.c
--- xgnokii/xgnokii.c~ 2005-01-24 23:45:30.000000000 +0100
+++ xgnokii/xgnokii.c 2005-01-24 23:45:30.000000000 +0100
@@ -2365,10 +2365,11 @@
/* we have set en_US.UTF8 locale that is not supported by xgnokii */
if (!LocaleHelpExists(xgnokiiConfig.help_locale)) {
char *pos = strchr(xgnokiiConfig.locale, '.');
- g_free(xgnokiiConfig.help_locale);
- if (pos)
+ if (pos) {
+ g_free(xgnokiiConfig.help_locale);
xgnokiiConfig.help_locale =
g_strndup(xgnokiiConfig.locale,
pos -
xgnokiiConfig.locale);
+ }
if (!LocaleHelpExists(xgnokiiConfig.help_locale)) {
g_free(xgnokiiConfig.help_locale);
xgnokiiConfig.help_locale = g_strdup("en_US");
Daniele