X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2FAcctCtrl.c;h=6ea5716c1611c8e705ffa024cef4f3eabcf63a63;hp=c60f9586dc971c8c2b5dc09851c024cb5a3b1cfe;hb=HEAD;hpb=6f8e0ca42d3d0b97b5e5747798a1eaffb44e8521 diff --git a/sources/AcctCtrl.c b/sources/AcctCtrl.c index c60f958..6ea5716 100644 --- a/sources/AcctCtrl.c +++ b/sources/AcctCtrl.c @@ -16,12 +16,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include /* directory */ -#include /* C standard library */ -#include -#include +#include /* primitive system data types */ +#include /* file characteristics constants and functions */ +#include /* directory operation constants and functions */ +#include /* C standard library */ +#include /* unix standard library */ +#include /* 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);