aboutsummaryrefslogtreecommitdiff
path: root/contrib/sendmail/mailstats
diff options
context:
space:
mode:
authorGregory Neil Shapiro <gshapiro@FreeBSD.org>2013-04-21 17:08:44 +0000
committerGregory Neil Shapiro <gshapiro@FreeBSD.org>2013-04-21 17:08:44 +0000
commit552d4955b823634ed151c69903f0b9d33e76e78e (patch)
treeab52d50bcac2932bf5e37126b12ef0d2886488f1 /contrib/sendmail/mailstats
parentd4bb04f686cc4600af4de408523b19917ace663f (diff)
parente388eedd7a4356992c2ecf5dcc8e77368cd9c391 (diff)
downloadsrc-552d4955b823634ed151c69903f0b9d33e76e78e.tar.gz
src-552d4955b823634ed151c69903f0b9d33e76e78e.zip
Merge sendmail 8.14.7 to HEAD
MFC after: 4 days
Notes
Notes: svn path=/head/; revision=249729
Diffstat (limited to 'contrib/sendmail/mailstats')
-rw-r--r--contrib/sendmail/mailstats/mailstats.c12
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);