summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/mailstats
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2013-04-21 17:08:44 +0000
committergshapiro <gshapiro@FreeBSD.org>2013-04-21 17:08:44 +0000
commit891f1b61da33280fa1ba153569b360771d27e984 (patch)
treeab52d50bcac2932bf5e37126b12ef0d2886488f1 /contrib/sendmail/mailstats
parent84dd41acc62e69379821ee9ff4d6461233543f07 (diff)
parenta03b7e14eaaeb30fff6859c589152c8787d230e3 (diff)
downloadFreeBSD-src-891f1b61da33280fa1ba153569b360771d27e984.zip
FreeBSD-src-891f1b61da33280fa1ba153569b360771d27e984.tar.gz
Merge sendmail 8.14.7 to HEAD
MFC after: 4 days
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 f8b57b3..739f57e 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);
OpenPOWER on IntegriCloud