summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Walton <dwalton@cumulusnetworks.com>2016-09-29 21:51:56 +0200
committerDaniel Walton <dwalton@cumulusnetworks.com>2016-09-29 21:51:56 +0200
commitabddf07563b9f00b6e256abf52b191f7c57655af (patch)
tree7887ac08b49341e8d1ad74c05c07256d0a7846e8 /lib
parentbgpd and zebra: scrubbed argc CHECK MEs (diff)
downloadfrr-abddf07563b9f00b6e256abf52b191f7c57655af.tar.xz
frr-abddf07563b9f00b6e256abf52b191f7c57655af.zip
all: scrubbed some argc CHECK MEs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/distribute.c2
-rw-r--r--lib/if.c7
-rw-r--r--lib/routemap.c13
-rw-r--r--lib/thread.c2
-rw-r--r--lib/vty.c6
5 files changed, 9 insertions, 21 deletions
diff --git a/lib/distribute.c b/lib/distribute.c
index e0b4f0468..8a0083391 100644
--- a/lib/distribute.c
+++ b/lib/distribute.c
@@ -308,7 +308,6 @@ DEFUN (distribute_list,
"Filter outgoing routing updates\n"
"Interface name\n")
{
- /* CHECK ME argc referenced below */
int prefix = (argv[1]->type == WORD_TKN) ? 1 : 0;
/* Check of distribute list type. */
@@ -340,7 +339,6 @@ DEFUN (no_distribute_list,
"Filter outgoing routing updates\n"
"Interface name\n")
{
- /* CHECK ME argc referenced below */
int prefix = (argv[2]->type == WORD_TKN) ? 1 : 0;
/* Check of distribute list type. */
diff --git a/lib/if.c b/lib/if.c
index 7b55a327c..382e69d61 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -756,10 +756,10 @@ DEFUN (interface,
"Interface's name\n"
VRF_CMD_HELP_STR)
{
- /* CHECK ME argc referenced below */
int idx_ifname = 1;
+ int idx_vrf = 3;
const char *ifname = argv[idx_ifname]->arg;
- const char *vrfname = (argc > 2) ? argv[3]->arg : NULL;
+ const char *vrfname = (argc > 2) ? argv[idx_vrf]->arg : NULL;
struct interface *ifp;
size_t sl;
@@ -901,8 +901,7 @@ DEFUN (show_address,
"address\n"
VRF_CMD_HELP_STR)
{
- /* CHECK ME argc referenced below */
- int idx_vrf_cmd_str = 2;
+ int idx_vrf = 3;
struct listnode *node;
struct listnode *node2;
struct interface *ifp;
diff --git a/lib/routemap.c b/lib/routemap.c
index 2b4ec0c67..b3d349d2f 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -1544,13 +1544,9 @@ DEFUN (rmap_onmatch_goto,
"Goto Clause number\n"
"Number\n")
{
- /* CHECK ME argc referenced below */
int idx_number = 2;
char *num = NULL;
- if (!strcmp (argv[0]->text, "continue"))
- num = argv[1]->arg;
- else
- num = argv[idx_number]->arg;
+ num = argv[idx_number]->arg;
struct route_map_index *index = vty->index;
int d = 0;
@@ -1565,7 +1561,7 @@ DEFUN (rmap_onmatch_goto,
return CMD_WARNING;
}
- if (argc == 1 && num)
+ if (num)
VTY_GET_INTEGER_RANGE("route-map index", d, num, 1, 65535);
else
d = index->pref + 1;
@@ -1634,10 +1630,9 @@ DEFUN (rmap_show_name,
"route-map information\n"
"route-map name\n")
{
- /* CHECK ME argc referenced below */
int idx_word = 2;
- const char *name = (argc == 3) ? argv[idx_word]->arg : NULL;
- return vty_show_route_map (vty, name);
+ const char *name = (argc == 3) ? argv[idx_word]->arg : NULL;
+ return vty_show_route_map (vty, name);
}
DEFUN (rmap_call,
diff --git a/lib/thread.c b/lib/thread.c
index eb85d57af..76acd0778 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -299,7 +299,6 @@ DEFUN (show_thread_cpu,
"Thread CPU usage\n"
"Display filter (rwtexb)\n")
{
- /* CHECK ME argc referenced below */
int idx_filter = 3;
int i = 0;
thread_type filter = (thread_type) -1U;
@@ -383,7 +382,6 @@ DEFUN (clear_thread_cpu,
"Thread CPU usage\n"
"Display filter (rwtexb)\n")
{
- /* CHECK ME argc referenced below */
int idx_filter = 3;
int i = 0;
thread_type filter = (thread_type) -1U;
diff --git a/lib/vty.c b/lib/vty.c
index 7fcf4565a..301af667e 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2797,10 +2797,9 @@ DEFUN (no_vty_access_class,
"Filter connections based on an IP access list\n"
"IP access list\n")
{
- /* CHECK ME argc referenced below */
int idx_word = 2;
const char *accesslist = (argc == 3) ? argv[idx_word]->arg : NULL;
- if (! vty_accesslist_name || (argc && strcmp(vty_accesslist_name, accesslist)))
+ if (! vty_accesslist_name || (argc == 3 && strcmp(vty_accesslist_name, accesslist)))
{
vty_out (vty, "Access-class is not currently applied to vty%s",
VTY_NEWLINE);
@@ -2841,12 +2840,11 @@ DEFUN (no_vty_ipv6_access_class,
"Filter connections based on an IP access list\n"
"IPv6 access list\n")
{
- /* CHECK ME argc referenced below */
int idx_word = 3;
const char *accesslist = (argc == 4) ? argv[idx_word]->arg : NULL;
if (! vty_ipv6_accesslist_name ||
- (argc && strcmp(vty_ipv6_accesslist_name, accesslist)))
+ (argc == 4 && strcmp(vty_ipv6_accesslist_name, accesslist)))
{
vty_out (vty, "IPv6 access-class is not currently applied to vty%s",
VTY_NEWLINE);