]> git.sur5r.net Git - ngadmin/blobdiff - cli/com_restart.c
Fix crash when reading the wrong type of VLAN
[ngadmin] / cli / com_restart.c
index 9c001d1aebc249c4ec6f9389aab498e665f139ec..c464828019c9ba42af6da76c6244cf68bac7d21f 100644 (file)
@@ -2,17 +2,23 @@
 #include "commands.h"
 
 
-bool do_restart (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga UNUSED)
+int do_restart (int argc, const char **argv UNUSED, struct ngadmin *nga UNUSED)
 {
-       int i, ret = true;
+       int i, ret = 0;
        const struct swi_attr *sa;
        char line[16];
        
        
+       if (argc > 0) {
+               printf("this command takes no argument\n");
+               ret = 1;
+               goto end;
+       }
+       
        sa = ngadmin_getCurrentSwitch(nga);
        if (sa == NULL) {
                printf("must be logged\n");
-               ret = false;
+               ret = 1;
                goto end;
        }