diff options
author | Florian Westphal <fw@strlen.de> | 2018-06-17 22:35:30 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-06-17 22:41:35 +0200 |
commit | 856a875aeb20708e1af2b6d5ca956df25e34f073 (patch) | |
tree | dab9b2f57f7ab920e6fe863016fbb97a6ce3de0a | |
parent | ae6e159a78c1431d3382af192c509d80fab25ce4 (diff) |
xtables: silence two compiler warnings
inlined from ‘do_commandarp’ at xtables-arp.c:1198:16:
xtables-arp.c:844:2: warning: ‘strncpy’ specified bound 29 equals destination size [-Wstringop-truncation]
strncpy(target->t->u.user.name, jumpto, sizeof(target->t->u.user.name));
xtables-eb-translate.c: In function ‘do_commandeb_xlate’:
xtables-eb-translate.c:285:6: warning: unused variable ‘chcounter’ [-Wunused-variable]
int chcounter = 0; /* Needed for -C */
^~~~~~~~~
Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r-- | iptables/xtables-arp.c | 2 | ||||
-rw-r--r-- | iptables/xtables-eb-translate.c | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/iptables/xtables-arp.c b/iptables/xtables-arp.c index 4a968f4b..c4cda7e0 100644 --- a/iptables/xtables-arp.c +++ b/iptables/xtables-arp.c @@ -841,7 +841,7 @@ static struct xtables_target *command_jump(struct arpt_entry *fw, target->t = xtables_calloc(1, size); target->t->u.target_size = size; - strncpy(target->t->u.user.name, jumpto, sizeof(target->t->u.user.name)); + strncpy(target->t->u.user.name, jumpto, sizeof(target->t->u.user.name) - 1); target->t->u.user.name[sizeof(target->t->u.user.name)-1] = '\0'; target->t->u.user.revision = target->revision; diff --git a/iptables/xtables-eb-translate.c b/iptables/xtables-eb-translate.c index 9ae1127e..42b88e35 100644 --- a/iptables/xtables-eb-translate.c +++ b/iptables/xtables-eb-translate.c @@ -282,7 +282,6 @@ static int do_commandeb_xlate(struct nft_handle *h, int argc, char *argv[], char { char *buffer; int c, i; - int chcounter = 0; /* Needed for -C */ int rule_nr = 0; int rule_nr_end = 0; int ret = 0; |