lib: argv update for thread.c

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2016-09-22 20:32:34 +00:00
parent 97e5b7c0b3
commit 1bf1b05af9

View File

@ -302,12 +302,12 @@ DEFUN (show_thread_cpu,
int i = 0; int i = 0;
thread_type filter = (thread_type) -1U; thread_type filter = (thread_type) -1U;
if (argc > 0) if (argc > 3)
{ {
filter = 0; filter = 0;
while (argv[0][i] != '\0') while (argv[3]->arg[i] != '\0')
{ {
switch ( argv[0][i] ) switch ( argv[3]->arg[i] )
{ {
case 'r': case 'r':
case 'R': case 'R':
@ -342,7 +342,7 @@ DEFUN (show_thread_cpu,
{ {
vty_out(vty, "Invalid filter \"%s\" specified," vty_out(vty, "Invalid filter \"%s\" specified,"
" must contain at least one of 'RWTEXB'%s", " must contain at least one of 'RWTEXB'%s",
argv[0], VTY_NEWLINE); argv[3]->arg, VTY_NEWLINE);
return CMD_WARNING; return CMD_WARNING;
} }
} }
@ -384,12 +384,12 @@ DEFUN (clear_thread_cpu,
int i = 0; int i = 0;
thread_type filter = (thread_type) -1U; thread_type filter = (thread_type) -1U;
if (argc > 0) if (argc > 3)
{ {
filter = 0; filter = 0;
while (argv[0][i] != '\0') while (argv[3]->arg[i] != '\0')
{ {
switch ( argv[0][i] ) switch ( argv[3]->arg[i] )
{ {
case 'r': case 'r':
case 'R': case 'R':
@ -424,7 +424,7 @@ DEFUN (clear_thread_cpu,
{ {
vty_out(vty, "Invalid filter \"%s\" specified," vty_out(vty, "Invalid filter \"%s\" specified,"
" must contain at least one of 'RWTEXB'%s", " must contain at least one of 'RWTEXB'%s",
argv[0], VTY_NEWLINE); argv[3]->arg, VTY_NEWLINE);
return CMD_WARNING; return CMD_WARNING;
} }
} }