Skip to content

Commit

Permalink
Merge pull request #3031 from pacovn/static_analysis__Wcomma
Browse files Browse the repository at this point in the history
bgpd isisd zebra: misuse of comma operator
  • Loading branch information
louberger authored Sep 17, 2018
2 parents a63834d + 1445b43 commit b4657ea
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
6 changes: 4 additions & 2 deletions bgpd/rfapi/rfapi_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,8 @@ register_add(struct vty *vty, struct cmd_token *carg_prefix,
"Missing parameter for local-next-hop\n");
return CMD_WARNING_CONFIG_FAILED;
}
++argv, --argc;
++argv;
--argc;
arg_lnh = argv[0]->arg;
}
if (strmatch(argv[0]->text, "local-cost")) {
Expand All @@ -2018,7 +2019,8 @@ register_add(struct vty *vty, struct cmd_token *carg_prefix,
"Missing parameter for local-cost\n");
return CMD_WARNING_CONFIG_FAILED;
}
++argv, --argc;
++argv;
--argc;
arg_lnh_cost = argv[0]->arg;
}
}
Expand Down
12 changes: 6 additions & 6 deletions isisd/isis_circuit.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,25 +897,25 @@ void isis_circuit_print_vty(struct isis_circuit *circuit, struct vty *vty,
vty_out(vty, " IP Prefix(es):\n");
for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, node,
ip_addr)) {
prefix2str(ip_addr, buf, sizeof(buf)),
vty_out(vty, " %s\n", buf);
prefix2str(ip_addr, buf, sizeof(buf));
vty_out(vty, " %s\n", buf);
}
}
if (circuit->ipv6_link && listcount(circuit->ipv6_link) > 0) {
vty_out(vty, " IPv6 Link-Locals:\n");
for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node,
ip_addr)) {
prefix2str(ip_addr, (char *)buf, BUFSIZ),
vty_out(vty, " %s\n", buf);
prefix2str(ip_addr, (char *)buf, BUFSIZ);
vty_out(vty, " %s\n", buf);
}
}
if (circuit->ipv6_non_link
&& listcount(circuit->ipv6_non_link) > 0) {
vty_out(vty, " IPv6 Prefixes:\n");
for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node,
ip_addr)) {
prefix2str(ip_addr, (char *)buf, BUFSIZ),
vty_out(vty, " %s\n", buf);
prefix2str(ip_addr, (char *)buf, BUFSIZ);
vty_out(vty, " %s\n", buf);
}
}

Expand Down
3 changes: 1 addition & 2 deletions zebra/zebra_ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ int zebra_ns_disable(ns_id_t ns_id, void **info)

hash_clean(zns->rules_hash, zebra_pbr_rules_free);
hash_free(zns->rules_hash);
hash_clean(zns->ipset_entry_hash,
zebra_pbr_ipset_entry_free),
hash_clean(zns->ipset_entry_hash, zebra_pbr_ipset_entry_free);
hash_clean(zns->ipset_hash, zebra_pbr_ipset_free);
hash_free(zns->ipset_hash);
hash_free(zns->ipset_entry_hash);
Expand Down
3 changes: 2 additions & 1 deletion zebra/zebra_vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ static void zvni_find_neigh_addr_width(struct hash_backet *backet, void *ctxt)

n = (zebra_neigh_t *)backet->data;

ipaddr2str(&n->ip, buf, sizeof(buf)), width = strlen(buf);
ipaddr2str(&n->ip, buf, sizeof(buf));
width = strlen(buf);
if (width > wctx->addr_width)
wctx->addr_width = width;

Expand Down

0 comments on commit b4657ea

Please sign in to comment.