summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-11-28 17:56:29 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2016-11-28 17:56:29 +0100
commit82992fed8c6426f431fa92933dcf4cfe4de926d6 (patch)
treec7c3afb35248073d61d8863e635580f2969296e5 /lib/thread.c
parentd7a64489f05d4bfba5e686aae941ef36eaa30688 (diff)
parentbf31fc8174b6d130b90e6ee1a67c543c3c8f1615 (diff)
Merge branch 'vtysh-grammar'
Conflicts: isisd/isisd.c lib/Makefile.am lib/thread.c Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/thread.c b/lib/thread.c
index 6ada7cd96a..ce93530ff1 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -287,15 +287,16 @@ DEFUN (show_thread_cpu,
"Thread CPU usage\n"
"Display filter (rwtexb)\n")
{
+ int idx_filter = 3;
int i = 0;
thread_type filter = (thread_type) -1U;
- if (argc > 0)
+ if (argc > 3)
{
filter = 0;
- while (argv[0][i] != '\0')
+ while (argv[idx_filter]->arg[i] != '\0')
{
- switch ( argv[0][i] )
+ switch ( argv[idx_filter]->arg[i] )
{
case 'r':
case 'R':
@@ -330,7 +331,7 @@ DEFUN (show_thread_cpu,
{
vty_out(vty, "Invalid filter \"%s\" specified,"
" must contain at least one of 'RWTEXB'%s",
- argv[0], VTY_NEWLINE);
+ argv[idx_filter]->arg, VTY_NEWLINE);
return CMD_WARNING;
}
}
@@ -369,15 +370,16 @@ DEFUN (clear_thread_cpu,
"Thread CPU usage\n"
"Display filter (rwtexb)\n")
{
+ int idx_filter = 3;
int i = 0;
thread_type filter = (thread_type) -1U;
- if (argc > 0)
+ if (argc > 3)
{
filter = 0;
- while (argv[0][i] != '\0')
+ while (argv[idx_filter]->arg[i] != '\0')
{
- switch ( argv[0][i] )
+ switch ( argv[idx_filter]->arg[i] )
{
case 'r':
case 'R':
@@ -412,7 +414,7 @@ DEFUN (clear_thread_cpu,
{
vty_out(vty, "Invalid filter \"%s\" specified,"
" must contain at least one of 'RWTEXB'%s",
- argv[0], VTY_NEWLINE);
+ argv[idx_filter]->arg, VTY_NEWLINE);
return CMD_WARNING;
}
}