Inserito programma per impostare l'accounting BSD, prima documentazione
[gapil.git] / sources / AcctCtrl.c
index c60f9586dc971c8c2b5dc09851c024cb5a3b1cfe..705cc7a23b86bcdbd5c9d41675e7791ec9dc2dc2 100644 (file)
@@ -70,11 +70,15 @@ int main(int argc, char *argv[])
      *               Main code beginning
      * 
      * ***********************************************************/
-    if ((argc - optind) != 1) {          /* There must be remaing parameters */
-       printf("Wrong number of arguments %d\n", argc - optind);
-        usage();
+    if (i == -1) {
+       printf("Specify option\n");
+       usage();
     }
     if (enable) {
+       if ((argc - optind) != 1) {      /* There must be remaing parameters */
+           printf("Wrong number of arguments %d\n", argc - optind);
+           usage();
+       }
        i = acct(argv[optind]);
     } else {
        i = acct(NULL);