From 84229373ed5ac6dbb132f6bd83260b6378437530 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Wed, 30 Dec 2009 10:06:09 +0800 Subject: [PATCH] Fix _FORTIFY_SOURCE warnings, from galtgendo --- client/x11/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/x11/main.c b/client/x11/main.c index d04a2f5..877d8c7 100644 --- a/client/x11/main.c +++ b/client/x11/main.c @@ -20,6 +20,8 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ +#define _GNU_SOURCES + #include #include #include @@ -37,7 +39,6 @@ #include #include -#define _GNU_SOURCES #include #define LOG(level, fmt_args...) \ @@ -1052,10 +1053,10 @@ 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)); + strncpy (_locale, optarg, sizeof (_locale) - strlen (_locale) - 1); } else if (g_strcmp0 (long_options[option_index].name, "locale-append") == 0) { - strncat (_locale, optarg, sizeof (_locale)); + strncat (_locale, optarg, sizeof (_locale) - strlen (_locale) - 1); } else if (g_strcmp0 (long_options[option_index].name, "help") == 0) { _print_usage (stdout, argv[0]); -- 2.7.4