]> git.sur5r.net Git - ngadmin/blobdiff - cli/com_help.c
Fix crash when reading the wrong type of VLAN
[ngadmin] / cli / com_help.c
index e1bad0e5289f8f6e71097ee46cdcba5df3e51510..34fc2bcf3d15b85662b095c74e343a83393e9da6 100644 (file)
@@ -2,17 +2,24 @@
 #include "commands.h"
 
 
-bool do_help (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga UNUSED)
+bool do_help (int argc, const char **argv UNUSED, struct ngadmin *nga UNUSED)
 {
        const struct TreeNode *s;
        
+       
+       if (argc > 0) {
+               printf("this command takes no argument\n");
+               return 1;
+       }
+       
        printf("Available commands: \n");
        
-       for (s = coms.sub; s->name != NULL; s++)
+       for (s = commands.sub; s->name != NULL; s++)
                printf("%s ", s->name);
        putchar('\n');
        
-       return true;
+       
+       return 0;
 }