]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: argv update for thread.c
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 22 Sep 2016 20:32:34 +0000 (20:32 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 22 Sep 2016 20:32:34 +0000 (20:32 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/thread.c

index a26eb6bfd21dd0fe6879524e8dda8f11610ed016..ba9a0ea2a655739ca21334a14fbb722333da7637 100644 (file)
@@ -302,12 +302,12 @@ DEFUN (show_thread_cpu,
   int i = 0;
   thread_type filter = (thread_type) -1U;
 
-  if (argc > 0)
+  if (argc > 3)
     {
       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':
@@ -342,7 +342,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[3]->arg, VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -384,12 +384,12 @@ DEFUN (clear_thread_cpu,
   int i = 0;
   thread_type filter = (thread_type) -1U;
 
-  if (argc > 0)
+  if (argc > 3)
     {
       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':
@@ -424,7 +424,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[3]->arg, VTY_NEWLINE);
          return CMD_WARNING;
        }
     }