From: Peng Huang Date: Wed, 30 Dec 2009 02:06:09 +0000 (+0800) Subject: Fix _FORTIFY_SOURCE warnings, from galtgendo X-Git-Tag: 1.2.0.20100111~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84229373ed5ac6dbb132f6bd83260b6378437530;p=platform%2Fupstream%2Fibus.git Fix _FORTIFY_SOURCE warnings, from galtgendo --- 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]);