diff options
Diffstat (limited to 'contrib/sendmail/mailstats')
-rw-r--r-- | contrib/sendmail/mailstats/mailstats.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/sendmail/mailstats/mailstats.c b/contrib/sendmail/mailstats/mailstats.c index f8b57b37bf00..739f57e39096 100644 --- a/contrib/sendmail/mailstats/mailstats.c +++ b/contrib/sendmail/mailstats/mailstats.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2002, 2013 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -20,7 +20,7 @@ SM_IDSTR(copyright, Copyright (c) 1988, 1993\n\ The Regents of the University of California. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Id: mailstats.c,v 8.100 2002/06/27 23:24:06 gshapiro Exp $") +SM_IDSTR(id, "@(#)$Id: mailstats.c,v 8.102 2013/03/12 15:24:50 ca Exp $") #include <unistd.h> #include <stddef.h> @@ -68,13 +68,14 @@ main(argc, argv) extern char *ctime(); extern char *optarg; extern int optind; +# define MSOPTS "cC:f:opP" cfile = getcfname(0, 0, SM_GET_SENDMAIL_CF, NULL); sfile = NULL; mnames = true; progmode = false; trunc = false; - while ((ch = getopt(argc, argv, "cC:f:opP")) != -1) + while ((ch = getopt(argc, argv, MSOPTS)) != -1) { switch (ch) { @@ -90,6 +91,7 @@ main(argc, argv) sfile = optarg; break; + case 'o': mnames = false; break; @@ -102,6 +104,7 @@ main(argc, argv) progmode = true; break; + case '?': default: usage: @@ -131,7 +134,7 @@ main(argc, argv) (void) sm_strlcpy(mtable[mno++], "*file*", MNAMELEN + 1); (void) sm_strlcpy(mtable[mno++], "*include*", MNAMELEN + 1); - while (sm_io_fgets(cfp, SM_TIME_DEFAULT, buf, sizeof(buf)) != NULL) + while (sm_io_fgets(cfp, SM_TIME_DEFAULT, buf, sizeof(buf)) >= 0) { register char *b; char *s; @@ -270,6 +273,7 @@ main(argc, argv) } } + if (progmode) { (void) time(&now); |