Aggiornamento note copyright
[gapil.git] / sources / AcctCtrl.c
index c60f9586dc971c8c2b5dc09851c024cb5a3b1cfe..6ea5716c1611c8e705ffa024cef4f3eabcf63a63 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>        /* directory */
-#include <stdlib.h>        /* C standard library */
-#include <unistd.h>
-#include <stdio.h>
+#include <sys/types.h>   /* primitive system data types */
+#include <sys/stat.h>    /* file characteristics constants and functions */
+#include <dirent.h>      /* directory operation constants and functions */
+#include <stdlib.h>      /* C standard library */
+#include <unistd.h>      /* unix standard library */
+#include <stdio.h>      /* standard I/O library */
 
 /*
  * Program AcctCtrl
@@ -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);