--- client/x11/main.c.old 2009-06-14 08:28:57.000000000 +0200 +++ client/x11/main.c.old 2009-10-18 05:33:08.000000000 +0200 @@ -19,6 +19,7 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ +#define _GNU_SOURCE #include #include #include @@ -36,7 +37,6 @@ #include #include -#define _GNU_SOURCES #include #define LOG(level, fmt_args...) \ @@ -103,7 +103,7 @@ static GHashTable *_connections = NULL; static XIMS _xims = NULL; static gchar _server_name[128] = "ibus"; -static gchar _locale[1024] = LOCALES_STRING; +static gchar* _locale = NULL; static gboolean _kill_daemon = FALSE; static gint g_debug_level = 0; @@ -1015,6 +1015,8 @@ { gint option_index = 0; gint c; + _locale = g_new0(char, 1024); + strcpy(_locale, LOCALES_STRING); gtk_init (&argc, &argv); XSetErrorHandler (_xerror_handler); @@ -1047,7 +1049,7 @@ strncpy (_locale, optarg, sizeof (_locale)); } else if (g_strcmp0 (long_options[option_index].name, "locale-append") == 0) { - strncat (_locale, optarg, sizeof (_locale)); + strncat (_locale, optarg, 1023-strlen(_locale)); } else if (g_strcmp0 (long_options[option_index].name, "help") == 0) { _print_usage (stdout, argv[0]);