summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/main.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/main.c b/src/main.c
index b02320a..6c72c38 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,3 +1,3 @@
/* This file is part of IPACCT
- Copyright (C) 1999,2000,2001,2002,2003,2004,2005 Sergey Poznyakoff
+ Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2008 Sergey Poznyakoff
@@ -16,3 +16,3 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-/* $Id: main.c,v 1.9 2005/05/20 12:59:53 gray Exp $ */
+/* $Id: main.c,v 1.10 2008/07/07 13:27:02 gray Exp $ */
#if defined(HAVE_CONFIG_H)
@@ -128,3 +128,3 @@ parse_opt (key, arg, state)
case 'c':
- profile = optarg;
+ profile = arg;
break;
@@ -134,9 +134,9 @@ parse_opt (key, arg, state)
case 'F':
- infile = optarg;
+ infile = arg;
break;
case 'i':
- device = optarg;
+ device = arg;
break;
case 'l':
- log_name = optarg;
+ log_name = arg;
break;
@@ -155,3 +155,3 @@ parse_opt (key, arg, state)
case 't':
- ttw = atoi(optarg);
+ ttw = atoi(arg);
if (ttw <= 0)
@@ -172,3 +172,3 @@ parse_opt (key, arg, state)
case 'u':
- user = optarg;
+ user = arg;
break;
@@ -315,4 +315,5 @@ main(argc, argv)
pid_t pid;
+ int index;
- if (argp_parse(&argp, argc, argv, 0, 0, NULL))
+ if (argp_parse(&argp, argc, argv, 0, &index, NULL))
exit(1);
@@ -328,7 +329,7 @@ main(argc, argv)
if (infile) {
- if (optind < argc)
- die(1, "excess arguments after %s", argv[optind]);
+ if (index < argc)
+ die(1, "excess arguments after %s", argv[index]);
expr = read_expr(infile);
- } else if (optind < argc)
- expr = copy_argv(argc, argv, optind);
+ } else if (index < argc)
+ expr = copy_argv(argc, argv, index);
@@ -410,3 +411,3 @@ init(device, cmdbuf)
- bzero((char *) &bpfcode, sizeof(bpfcode));
+ memset(&bpfcode, 0, sizeof(bpfcode));

Return to:

Send suggestions and report system problems to the System administrator.