From: Peng Huang Date: Sat, 9 Jan 2010 09:12:56 +0000 (+0800) Subject: Fix problems in XIM server. X-Git-Tag: 1.2.0.20100111~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6510918a09d502f9449288cc70fb20d892890396;p=platform%2Fupstream%2Fibus.git Fix problems in XIM server. --- diff --git a/client/x11/main.c b/client/x11/main.c index c780b271..ce779b1e 100644 --- a/client/x11/main.c +++ b/client/x11/main.c @@ -108,7 +108,7 @@ static GHashTable *_x11_ic_table = NULL; static GHashTable *_connections = NULL; static XIMS _xims = NULL; static gchar _server_name[128] = "ibus"; -static gchar _locale[1024] = LOCALES_STRING; +static gchar _locale[4096] = LOCALES_STRING; static gboolean _kill_daemon = FALSE; static gint g_debug_level = 0; @@ -1053,7 +1053,7 @@ main (int argc, char **argv) strncpy (_server_name, optarg, sizeof (_server_name)); } else if (g_strcmp0 (long_options[option_index].name, "locale") == 0) { - strncpy (_locale, optarg, sizeof (_locale) - strlen (_locale) - 1); + strncpy (_locale, optarg, sizeof (_locale)); } else if (g_strcmp0 (long_options[option_index].name, "locale-append") == 0) { strncat (_locale, optarg, sizeof (_locale) - strlen (_locale) - 1); @@ -1076,7 +1076,7 @@ main (int argc, char **argv) strncpy (_locale, optarg, sizeof (_locale)); break; case 'a': - strncat (_locale, optarg, sizeof (_locale)); + strncat (_locale, optarg, sizeof (_locale) - strlen (_locale) - 1); break; case 'k': _kill_daemon = TRUE;