From 56993546c80576986930f9bae7ae4ba744b1e508 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 6 Jun 2018 14:21:57 +0200 Subject: extensions: fix build failure on fc28 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit make fails via: extensions/ebt_string.c: In function ‘parse’: extensions/ebt_string.c:171:3: error: ‘strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation] strncpy(info->algo, optarg, XT_STRING_MAX_ALGO_NAME_SIZE); Signed-off-by: Florian Westphal --- extensions/ebt_string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extensions/ebt_string.c') diff --git a/extensions/ebt_string.c b/extensions/ebt_string.c index 9550c41..3deff1b 100644 --- a/extensions/ebt_string.c +++ b/extensions/ebt_string.c @@ -168,7 +168,7 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, ebt_check_option2(flags, OPT_STRING_ALGO); if (ebt_check_inverse2(optarg)) ebt_print_error2("Unexpected `!' after --string-algo"); - strncpy(info->algo, optarg, XT_STRING_MAX_ALGO_NAME_SIZE); + snprintf(info->algo, sizeof(info->algo), "%s", optarg); break; case STRING_ICASE: ebt_check_option2(flags, OPT_STRING_ICASE); -- cgit v1.2.3