]> git.sur5r.net Git - ngadmin/blobdiff - cli/com_list.c
Fix crash when reading the wrong type of VLAN
[ngadmin] / cli / com_list.c
index 9630f76d05392ddbb9886f0121bcc3b24889a37e..853f8f371f79055e33fa18bfdaa3989a904c26b6 100644 (file)
@@ -2,19 +2,22 @@
 #include "commands.h"
 
 
-
-bool do_list (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga) {
- int n;
- const struct swi_attr *sa;
- sa=ngadmin_getSwitchTab(nga, &n);
- displaySwitchTab(sa, n);
- return true;
+bool do_list (int argc, const char **argv UNUSED, struct ngadmin *nga)
+{
+       int n;
+       const struct swi_attr *sa;
+       
+       
+       if (argc > 0) {
+               printf("this command takes no argument\n");
+               return 1;
+       }
+       
+       sa = ngadmin_getSwitchTab(nga, &n);
+       displaySwitchTab(sa, n);
+       
+       
+       return 0;
 }