(partially) ANSI-fy it
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 15 Nov 1992 03:34:42 +0000 (19:34 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 15 Nov 1992 03:34:42 +0000 (19:34 -0800)
SCCS-vsn: usr.sbin/sendmail/src/useful.h 4.7
SCCS-vsn: usr.sbin/sendmail/src/headers.c 5.25
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 5.24
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 5.37
SCCS-vsn: usr.sbin/sendmail/src/main.c 5.59
SCCS-vsn: usr.sbin/sendmail/src/envelope.c 5.32
SCCS-vsn: usr.sbin/sendmail/src/conf.h 5.28
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 5.25
SCCS-vsn: usr.sbin/sendmail/src/err.c 5.15
SCCS-vsn: usr.sbin/sendmail/src/collect.c 5.14
SCCS-vsn: usr.sbin/sendmail/src/version.c 5.123
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 5.40
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 5.21
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 5.51
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 5.39
SCCS-vsn: usr.sbin/sendmail/src/clock.c 5.11
SCCS-vsn: usr.sbin/sendmail/src/util.c 5.32
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 5.48
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 5.66
SCCS-vsn: usr.sbin/sendmail/src/queue.c 5.50
SCCS-vsn: usr.sbin/sendmail/src/conf.c 5.43
SCCS-vsn: usr.sbin/sendmail/src/alias.c 5.38
SCCS-vsn: usr.sbin/sendmail/src/udb.c 5.20

23 files changed:
usr/src/usr.sbin/sendmail/src/alias.c
usr/src/usr.sbin/sendmail/src/clock.c
usr/src/usr.sbin/sendmail/src/collect.c
usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/conf.h
usr/src/usr.sbin/sendmail/src/daemon.c
usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/envelope.c
usr/src/usr.sbin/sendmail/src/err.c
usr/src/usr.sbin/sendmail/src/headers.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/parseaddr.c
usr/src/usr.sbin/sendmail/src/queue.c
usr/src/usr.sbin/sendmail/src/readcf.c
usr/src/usr.sbin/sendmail/src/recipient.c
usr/src/usr.sbin/sendmail/src/savemail.c
usr/src/usr.sbin/sendmail/src/sendmail.h
usr/src/usr.sbin/sendmail/src/srvrsmtp.c
usr/src/usr.sbin/sendmail/src/udb.c
usr/src/usr.sbin/sendmail/src/useful.h
usr/src/usr.sbin/sendmail/src/usersmtp.c
usr/src/usr.sbin/sendmail/src/util.c
usr/src/usr.sbin/sendmail/src/version.c

index 4e33c3a..ae53218 100644 (file)
 
 #ifndef lint
 #ifdef NEWDB
 
 #ifndef lint
 #ifdef NEWDB
-static char sccsid[] = "@(#)alias.c    5.37 (Berkeley) %G% (with NEWDB)";
+static char sccsid[] = "@(#)alias.c    5.38 (Berkeley) %G% (with NEWDB)";
 #else
 #ifdef DBM
 #else
 #ifdef DBM
-static char sccsid[] = "@(#)alias.c    5.37 (Berkeley) %G% (with DBM)";
+static char sccsid[] = "@(#)alias.c    5.38 (Berkeley) %G% (with DBM)";
 #else
 #else
-static char sccsid[] = "@(#)alias.c    5.37 (Berkeley) %G% (without DBM)";
+static char sccsid[] = "@(#)alias.c    5.38 (Berkeley) %G% (without DBM)";
 #endif
 #endif
 #endif /* not lint */
 #endif
 #endif
 #endif /* not lint */
@@ -340,14 +340,14 @@ initaliases(aliasfile, init, e)
 #ifdef LOG
                        if (LogLevel >= 7)
                                syslog(LOG_INFO, "rebuilding alias database");
 #ifdef LOG
                        if (LogLevel >= 7)
                                syslog(LOG_INFO, "rebuilding alias database");
-#endif LOG
+#endif /* LOG */
                }
                else
                {
 #ifdef LOG
                        if (LogLevel >= 7)
                                syslog(LOG_INFO, "alias database out of date");
                }
                else
                {
 #ifdef LOG
                        if (LogLevel >= 7)
                                syslog(LOG_INFO, "alias database out of date");
-#endif LOG
+#endif /* LOG */
                        message(Arpa_Info, "Warning: alias database out of date");
                }
        }
                        message(Arpa_Info, "Warning: alias database out of date");
                }
        }
@@ -368,12 +368,12 @@ initaliases(aliasfile, init, e)
                        syslog(LOG_NOTICE, "alias database %srebuilt by %s",
                                automatic ? "auto" : "", username());
                }
                        syslog(LOG_NOTICE, "alias database %srebuilt by %s",
                                automatic ? "auto" : "", username());
                }
-#endif LOG
+#endif /* LOG */
                readaliases(aliasfile, TRUE, e);
        }
                readaliases(aliasfile, TRUE, e);
        }
-# else DBM
+# else /* DBM */
        readaliases(aliasfile, init, e);
        readaliases(aliasfile, init, e);
-# endif DBM
+# endif /* DBM */
 }
 \f/*
 **  READALIASES -- read and process the alias file.
 }
 \f/*
 **  READALIASES -- read and process the alias file.
@@ -451,7 +451,7 @@ readaliases(aliasfile, init, e)
                errno = 0;
                return;
        }
                errno = 0;
                return;
        }
-# endif DBM
+# endif /* DBM */
 
        /*
        **  If initializing, create the new DBM files.
 
        /*
        **  If initializing, create the new DBM files.
@@ -512,7 +512,7 @@ readaliases(aliasfile, init, e)
                int lhssize, rhssize;
 
                LineNumber++;
                int lhssize, rhssize;
 
                LineNumber++;
-               p = index(line, '\n');
+               p = strchr(line, '\n');
                if (p != NULL)
                        *p = '\0';
                switch (line[0])
                if (p != NULL)
                        *p = '\0';
                switch (line[0])
@@ -673,7 +673,7 @@ readaliases(aliasfile, init, e)
 # endif
                }
                else
 # endif
                }
                else
-# endif DBM
+# endif /* DBM */
                {
                        s = stab(al.q_user, ST_ALIAS, ST_ENTER);
                        s->s_alias = newstr(rhs);
                {
                        s = stab(al.q_user, ST_ALIAS, ST_ENTER);
                        s->s_alias = newstr(rhs);
@@ -708,7 +708,7 @@ readaliases(aliasfile, init, e)
                /* restore the old signal */
                (void) signal(SIGINT, oldsigint);
        }
                /* restore the old signal */
                (void) signal(SIGINT, oldsigint);
        }
-# endif DBM
+# endif /* DBM */
 
        /* closing the alias file drops the lock */
        (void) fclose(af);
 
        /* closing the alias file drops the lock */
        (void) fclose(af);
@@ -720,7 +720,7 @@ readaliases(aliasfile, init, e)
        if (LogLevel >= 8)
                syslog(LOG_INFO, "%d aliases, longest %d bytes, %d bytes total",
                        naliases, longest, bytes);
        if (LogLevel >= 8)
                syslog(LOG_INFO, "%d aliases, longest %d bytes, %d bytes total",
                        naliases, longest, bytes);
-# endif LOG
+# endif /* LOG */
 }
 \f/*
 **  FORWARD -- Try to forward mail
 }
 \f/*
 **  FORWARD -- Try to forward mail
index 2102a50..214d794 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)clock.c    5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)clock.c    5.11 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -163,7 +163,7 @@ tick()
 #ifdef SIGVTALRM
                /* reset 4.2bsd signal mask to allow future alarms */
                (void) sigsetmask(sigblock(0) & ~sigmask(SIGALRM));
 #ifdef SIGVTALRM
                /* reset 4.2bsd signal mask to allow future alarms */
                (void) sigsetmask(sigblock(0) & ~sigmask(SIGALRM));
-#endif SIGVTALRM
+#endif /* SIGVTALRM */
 
                f = ev->ev_func;
                arg = ev->ev_arg;
 
                f = ev->ev_func;
                arg = ev->ev_arg;
index d5b19f5..c04af91 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)collect.c  5.13 (Berkeley) %G%";
+static char sccsid[] = "@(#)collect.c  5.14 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <errno.h>
 #endif /* not lint */
 
 # include <errno.h>
@@ -84,7 +84,7 @@ maketemp(from)
                        goto readerr;
                fixcrlf(buf, FALSE);
        }
                        goto readerr;
                fixcrlf(buf, FALSE);
        }
-# endif NOTUNIX
+# endif /* NOTUNIX */
 
        /*
        **  Copy InChannel to temp file & do message editing.
 
        /*
        **  Copy InChannel to temp file & do message editing.
@@ -294,7 +294,7 @@ flusheol(buf, fp)
        char junkbuf[MAXLINE], *sfgets();
        register char *p = buf;
 
        char junkbuf[MAXLINE], *sfgets();
        register char *p = buf;
 
-       while (index(p, '\n') == NULL) {
+       while (strchr(p, '\n') == NULL) {
                if (sfgets(junkbuf,MAXLINE,fp) == NULL)
                        return(FALSE);
                p = junkbuf;
                if (sfgets(junkbuf,MAXLINE,fp) == NULL)
                        return(FALSE);
                p = junkbuf;
@@ -412,4 +412,4 @@ eatfrom(fm, e)
        }
 }
 
        }
 }
 
-# endif NOTUNIX
+# endif /* NOTUNIX */
index 7a284b4..eaf7dfa 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)conf.c     5.42 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c     5.43 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <sys/ioctl.h>
 #endif /* not lint */
 
 # include <sys/ioctl.h>
@@ -425,7 +425,7 @@ checkcompat(to, e)
                /* NoReturn = TRUE; to supress return copy */
                return (FALSE);
        }
                /* NoReturn = TRUE; to supress return copy */
                return (FALSE);
        }
-# endif EXAMPLE_CODE
+# endif /* EXAMPLE_CODE */
        return (TRUE);
 }
 \f/*
        return (TRUE);
 }
 \f/*
@@ -684,7 +684,7 @@ setproctitle(fmt, a, b, c)
        p = &Argv[0][i];
        while (p < LastArgv)
                *p++ = ' ';
        p = &Argv[0][i];
        while (p < LastArgv)
                *p++ = ' ';
-# endif SETPROCTITLE
+# endif /* SETPROCTITLE */
 }
 \f/*
 **  REAPCHILD -- pick up the body of my child, lest it become a zombie
 }
 \f/*
 **  REAPCHILD -- pick up the body of my child, lest it become a zombie
@@ -709,12 +709,12 @@ reapchild()
 
        while (wait3((int *)&status, WNOHANG, (struct rusage *) NULL) > 0)
                continue;
 
        while (wait3((int *)&status, WNOHANG, (struct rusage *) NULL) > 0)
                continue;
-# else WNOHANG
+# else /* WNOHANG */
        auto int status;
 
        while (wait((int *)&status) > 0)
                continue;
        auto int status;
 
        while (wait((int *)&status) > 0)
                continue;
-# endif WNOHANG
+# endif /* WNOHANG */
 }
 \f/*
 **  UNSETENV -- remove a variable from the environment
 }
 \f/*
 **  UNSETENV -- remove a variable from the environment
index cc45fe6..d85d644 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)conf.h      5.27 (Berkeley) %G%
+ *     @(#)conf.h      5.28 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
index ebef8b1..f79f841 100644 (file)
@@ -12,9 +12,9 @@
 
 #ifndef lint
 #ifdef DAEMON
 
 #ifndef lint
 #ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c   5.50 (Berkeley) %G% (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c   5.51 (Berkeley) %G% (with daemon mode)";
 #else
 #else
-static char sccsid[] = "@(#)daemon.c   5.50 (Berkeley) %G% (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c   5.51 (Berkeley) %G% (without daemon mode)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -117,7 +117,7 @@ getrequests()
          severe:
 # ifdef LOG
                if (LogLevel > 0)
          severe:
 # ifdef LOG
                if (LogLevel > 0)
-# endif LOG
+# endif /* LOG */
                finis();
        }
 
                finis();
        }
 
@@ -196,7 +196,7 @@ makeconnection(host, port, mci, usesecureport)
        if (host[0] == '[')
        {
                long hid;
        if (host[0] == '[')
        {
                long hid;
-               register char *p = index(host, ']');
+               register char *p = strchr(host, ']');
 
                if (p != NULL)
                {
 
                if (p != NULL)
                {
@@ -453,7 +453,7 @@ maphostname(hbuf, hbsize, avp)
                else
                        return NULL;
        }
                else
                        return NULL;
        }
-       if ((cp = index(strcpy(ptr, hbuf), ']')) == NULL)
+       if ((cp = strchr(strcpy(ptr, hbuf), ']')) == NULL)
                return (NULL);
        *cp = '\0';
        in_addr = inet_addr(&ptr[1]);
                return (NULL);
        *cp = '\0';
        in_addr = inet_addr(&ptr[1]);
@@ -470,7 +470,7 @@ maphostname(hbuf, hbsize, avp)
        return hbuf;
 }
 
        return hbuf;
 }
 
-# else DAEMON
+# else /* DAEMON */
 /* code for systems without sophisticated networking */
 
 /*
 /* code for systems without sophisticated networking */
 
 /*
@@ -527,4 +527,4 @@ maphostname(hbuf, hbsize, avp)
        return NULL;
 }
 
        return NULL;
 }
 
-#endif DAEMON
+#endif /* DAEMON */
index a959dca..019d94c 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)deliver.c  5.65 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c  5.66 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -167,7 +167,7 @@ deliver(e, firstto)
 
        for (mvp = m->m_argv; (p = *++mvp) != NULL; )
        {
 
        for (mvp = m->m_argv; (p = *++mvp) != NULL; )
        {
-               while ((p = index(p, '\001')) != NULL)
+               while ((p = strchr(p, '\001')) != NULL)
                        if (*++p == 'u')
                                break;
                if (p != NULL)
                        if (*++p == 'u')
                                break;
                if (p != NULL)
@@ -195,11 +195,11 @@ deliver(e, firstto)
 # ifdef SMTP
                clever = TRUE;
                *pvp = NULL;
 # ifdef SMTP
                clever = TRUE;
                *pvp = NULL;
-# else SMTP
+# else /* SMTP */
                /* oops!  we don't implement SMTP */
                syserr("SMTP style mailer");
                return (EX_SOFTWARE);
                /* oops!  we don't implement SMTP */
                syserr("SMTP style mailer");
                return (EX_SOFTWARE);
-# endif SMTP
+# endif /* SMTP */
        }
 
        /*
        }
 
        /*
@@ -841,7 +841,7 @@ openmailer(m, pvp, ctladdr, clever, e)
                (void) fflush(stdout);
 # ifdef SIGCHLD
                (void) signal(SIGCHLD, SIG_DFL);
                (void) fflush(stdout);
 # ifdef SIGCHLD
                (void) signal(SIGCHLD, SIG_DFL);
-# endif SIGCHLD
+# endif /* SIGCHLD */
                DOFORK(FORK);
                /* pid is set by DOFORK */
                if (pid < 0)
                DOFORK(FORK);
                /* pid is set by DOFORK */
                if (pid < 0)
@@ -1048,9 +1048,9 @@ giveresponse(stat, m, e)
                                extern char SmtpError[];
 
                                statmsg = SmtpError;
                                extern char SmtpError[];
 
                                statmsg = SmtpError;
-#else SMTP
+#else /* SMTP */
                                statmsg = NULL;
                                statmsg = NULL;
-#endif SMTP
+#endif /* SMTP */
                        }
                }
                if (statmsg != NULL && statmsg[0] != '\0')
                        }
                }
                if (statmsg != NULL && statmsg[0] != '\0')
@@ -1122,7 +1122,7 @@ logdelivery(stat, e)
 # ifdef LOG
        syslog(LOG_INFO, "%s: to=%s, delay=%s, stat=%s", e->e_id,
               e->e_to, pintvl(curtime() - e->e_ctime, TRUE), stat);
 # ifdef LOG
        syslog(LOG_INFO, "%s: to=%s, delay=%s, stat=%s", e->e_id,
               e->e_to, pintvl(curtime() - e->e_ctime, TRUE), stat);
-# endif LOG
+# endif /* LOG */
 }
 \f/*
 **  PUTFROMLINE -- output a UNIX-style from line (or whatever)
 }
 \f/*
 **  PUTFROMLINE -- output a UNIX-style from line (or whatever)
@@ -1166,7 +1166,7 @@ putfromline(fp, m, e)
                char xbuf[MAXLINE];
 
                expand("\001<", buf, &buf[sizeof buf - 1], e);
                char xbuf[MAXLINE];
 
                expand("\001<", buf, &buf[sizeof buf - 1], e);
-               bang = index(buf, '!');
+               bang = strchr(buf, '!');
                if (bang == NULL)
                        syserr("No ! in UUCP! (%s)", buf);
                else
                if (bang == NULL)
                        syserr("No ! in UUCP! (%s)", buf);
                else
@@ -1176,7 +1176,7 @@ putfromline(fp, m, e)
                        template = xbuf;
                }
        }
                        template = xbuf;
                }
        }
-# endif UGLYUUCP
+# endif /* UGLYUUCP */
        expand(template, buf, &buf[sizeof buf - 1], e);
        putline(buf, fp, m);
 }
        expand(template, buf, &buf[sizeof buf - 1], e);
        putline(buf, fp, m);
 }
@@ -1466,7 +1466,7 @@ sendall(e, mode)
             (mode != SM_VERIFY && SuperSafe)) &&
            !bitset(EF_INQUEUE, e->e_flags))
                queueup(e, TRUE, mode == SM_QUEUE);
             (mode != SM_VERIFY && SuperSafe)) &&
            !bitset(EF_INQUEUE, e->e_flags))
                queueup(e, TRUE, mode == SM_QUEUE);
-#endif QUEUE
+#endif /* QUEUE */
 
        oldverbose = Verbose;
        switch (mode)
 
        oldverbose = Verbose;
        switch (mode)
index 3c903a6..304ed2b 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)envelope.c 5.31 (Berkeley) %G%";
+static char sccsid[] = "@(#)envelope.c 5.32 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -90,7 +90,7 @@ dropenvelope(e)
                syslog(LOG_DEBUG, "dropenvelope, id=%s, flags=%o, pid=%d",
                                  e->e_id == NULL ? "(none)" : e->e_id,
                                  e->e_flags, getpid());
                syslog(LOG_DEBUG, "dropenvelope, id=%s, flags=%o, pid=%d",
                                  e->e_id == NULL ? "(none)" : e->e_id,
                                  e->e_flags, getpid());
-#endif LOG
+#endif /* LOG */
 
        /* we must have an id to remove disk files */
        if (e->e_id == NULL)
 
        /* we must have an id to remove disk files */
        if (e->e_id == NULL)
@@ -140,9 +140,9 @@ dropenvelope(e)
        {
 #ifdef QUEUE
                queueup(e, FALSE, FALSE);
        {
 #ifdef QUEUE
                queueup(e, FALSE, FALSE);
-#else QUEUE
+#else /* QUEUE */
                syserr("dropenvelope: queueup");
                syserr("dropenvelope: queueup");
-#endif QUEUE
+#endif /* QUEUE */
        }
 
        /* now unlock the job */
        }
 
        /* now unlock the job */
@@ -229,7 +229,7 @@ initsys(e)
 #ifdef TTYNAME
        static char ybuf[10];                   /* holds tty id */
        register char *p;
 #ifdef TTYNAME
        static char ybuf[10];                   /* holds tty id */
        register char *p;
-#endif TTYNAME
+#endif /* TTYNAME */
        extern char *ttyname();
        extern char *macvalue();
        extern char Version[];
        extern char *ttyname();
        extern char *macvalue();
        extern char Version[];
@@ -274,13 +274,13 @@ initsys(e)
                p = ttyname(2);
                if (p != NULL)
                {
                p = ttyname(2);
                if (p != NULL)
                {
-                       if (rindex(p, '/') != NULL)
-                               p = rindex(p, '/') + 1;
+                       if (strrchr(p, '/') != NULL)
+                               p = strrchr(p, '/') + 1;
                        (void) strcpy(ybuf, p);
                        define('y', ybuf, e);
                }
        }
                        (void) strcpy(ybuf, p);
                        define('y', ybuf, e);
                }
        }
-#endif TTYNAME
+#endif /* TTYNAME */
 }
 \f/*
 **  SETTIME -- set the current time.
 }
 \f/*
 **  SETTIME -- set the current time.
@@ -313,7 +313,7 @@ settime(e)
                        tm->tm_mday, tm->tm_hour, tm->tm_min);
        define('t', tbuf, e);
        (void) strcpy(dbuf, ctime(&now));
                        tm->tm_mday, tm->tm_hour, tm->tm_min);
        define('t', tbuf, e);
        (void) strcpy(dbuf, ctime(&now));
-       *index(dbuf, '\n') = '\0';
+       *strchr(dbuf, '\n') = '\0';
        if (macvalue('d', e) == NULL)
                define('d', dbuf, e);
        p = newstr(arpadate(dbuf));
        if (macvalue('d', e) == NULL)
                define('d', dbuf, e);
        p = newstr(arpadate(dbuf));
@@ -346,7 +346,7 @@ openxscript(e)
 # ifdef LOG
        if (LogLevel > 19)
                syslog(LOG_DEBUG, "%s: openx%s", e->e_id, e->e_xfp == NULL ? "" : " (no)");
 # ifdef LOG
        if (LogLevel > 19)
                syslog(LOG_DEBUG, "%s: openx%s", e->e_id, e->e_xfp == NULL ? "" : " (no)");
-# endif LOG
+# endif /* LOG */
        if (e->e_xfp != NULL)
                return;
        p = queuename(e, 'x');
        if (e->e_xfp != NULL)
                return;
        p = queuename(e, 'x');
@@ -451,7 +451,7 @@ setsender(from, e)
                extern bool trusteduser();
 
                if (!trusteduser(realname) && getuid() != geteuid() &&
                extern bool trusteduser();
 
                if (!trusteduser(realname) && getuid() != geteuid() &&
-                   index(from, '!') == NULL && getuid() != 0)
+                   strchr(from, '!') == NULL && getuid() != 0)
                {
                        /* network sends -r regardless (why why why?) */
                        /* syserr("%s, you cannot use the -f flag", realname); */
                {
                        /* network sends -r regardless (why why why?) */
                        /* syserr("%s, you cannot use the -f flag", realname); */
@@ -474,7 +474,7 @@ setsender(from, e)
                                "from=%s unparseable, received from %s@%s",
                                from, realname, host);
                }
                                "from=%s unparseable, received from %s@%s",
                                from, realname, host);
                }
-# endif LOG
+# endif /* LOG */
                from = newstr(realname);
                if (parseaddr(from, &e->e_from, 1, '\0', e) == NULL &&
                    parseaddr("postmaster", &e->e_from, 1, '\0', e) == NULL)
                from = newstr(realname);
                if (parseaddr(from, &e->e_from, 1, '\0', e) == NULL &&
                    parseaddr("postmaster", &e->e_from, 1, '\0', e) == NULL)
index a380ee2..348292c 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)err.c      5.14 (Berkeley) %G%";
+static char sccsid[] = "@(#)err.c      5.15 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -72,7 +72,7 @@ syserr(fmt, a, b, c, d, e)
                syslog(LOG_CRIT, "%s: SYSERR: %s",
                        CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
                        &MsgBuf[4]);
                syslog(LOG_CRIT, "%s: SYSERR: %s",
                        CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
                        &MsgBuf[4]);
-# endif LOG
+# endif /* LOG */
        errno = 0;
        if (QuickAbort)
                longjmp(TopFrame, 2);
        errno = 0;
        if (QuickAbort)
                longjmp(TopFrame, 2);
@@ -112,7 +112,7 @@ usrerr(fmt, a, b, c, d, e)
                syslog(LOG_NOTICE, "%s: %s",
                        CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
                        &MsgBuf[4]);
                syslog(LOG_NOTICE, "%s: %s",
                        CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
                        &MsgBuf[4]);
-# endif LOG
+# endif /* LOG */
 
        if (QuickAbort)
                longjmp(TopFrame, 1);
 
        if (QuickAbort)
                longjmp(TopFrame, 1);
@@ -322,7 +322,7 @@ errstring(errno)
        static char buf[100];
 # ifdef SMTP
        extern char *SmtpPhase;
        static char buf[100];
 # ifdef SMTP
        extern char *SmtpPhase;
-# endif SMTP
+# endif /* SMTP */
 
 # ifdef DAEMON
 # ifdef ETIMEDOUT
 
 # ifdef DAEMON
 # ifdef ETIMEDOUT
index 33719b3..26139f4 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)headers.c  5.24 (Berkeley) %G%";
+static char sccsid[] = "@(#)headers.c  5.25 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <sys/param.h>
 #endif /* not lint */
 
 # include <sys/param.h>
@@ -56,7 +56,7 @@ chompheader(line, def, e)
        if (def && *p == '?')
        {
                /* have some */
        if (def && *p == '?')
        {
                /* have some */
-               register char *q = index(p + 1, *p);
+               register char *q = strchr(p + 1, *p);
                
                if (q != NULL)
                {
                
                if (q != NULL)
                {
@@ -72,7 +72,7 @@ chompheader(line, def, e)
 
        /* find canonical name */
        fname = p;
 
        /* find canonical name */
        fname = p;
-       p = index(p, ':');
+       p = strchr(p, ':');
        if (p == NULL)
        {
                syserr("chompheader: syntax error, line \"%s\"", line);
        if (p == NULL)
        {
                syserr("chompheader: syntax error, line \"%s\"", line);
@@ -151,8 +151,8 @@ chompheader(line, def, e)
 
        /* hack to see if this is a new format message */
        if (!def && bitset(H_RCPT|H_FROM, h->h_flags) &&
 
        /* hack to see if this is a new format message */
        if (!def && bitset(H_RCPT|H_FROM, h->h_flags) &&
-           (index(fvalue, ',') != NULL || index(fvalue, '(') != NULL ||
-            index(fvalue, '<') != NULL || index(fvalue, ';') != NULL))
+           (strchr(fvalue, ',') != NULL || strchr(fvalue, '(') != NULL ||
+            strchr(fvalue, '<') != NULL || strchr(fvalue, ';') != NULL))
        {
                e->e_flags &= ~EF_OLDSTYLE;
        }
        {
                e->e_flags &= ~EF_OLDSTYLE;
        }
@@ -328,7 +328,7 @@ eatheader(e)
                        }
                        syslog(LOG_INFO, "%s: message-id=%s", e->e_id, p);
                }
                        }
                        syslog(LOG_INFO, "%s: message-id=%s", e->e_id, p);
                }
-#endif LOG
+#endif /* LOG */
        }
        if (tTd(32, 1))
                printf("----------------------------\n");
        }
        if (tTd(32, 1))
                printf("----------------------------\n");
@@ -396,7 +396,7 @@ eatheader(e)
                    e->e_id, e->e_from.q_paddr, e->e_msgsize,
                    e->e_class, name);
        }
                    e->e_id, e->e_from.q_paddr, e->e_msgsize,
                    e->e_class, name);
        }
-# endif LOG
+# endif /* LOG */
 }
 \f/*
 **  PRIENCODE -- encode external priority names into internal values.
 }
 \f/*
 **  PRIENCODE -- encode external priority names into internal values.
@@ -568,7 +568,7 @@ crackaddr(addr)
 
 
                /* check for characters that may have to be quoted */
 
 
                /* check for characters that may have to be quoted */
-               if (index(".'@,;:[]", c) != NULL)
+               if (strchr(".'@,;:[]", c) != NULL)
                {
                        /*
                        **  If these occur as the phrase part of a <>
                {
                        /*
                        **  If these occur as the phrase part of a <>
@@ -738,7 +738,7 @@ putheader(fp, m, e)
                        register char *nlp;
 
                        (void) sprintf(obuf, "%s: ", capitalize(h->h_field));
                        register char *nlp;
 
                        (void) sprintf(obuf, "%s: ", capitalize(h->h_field));
-                       while ((nlp = index(p, '\n')) != NULL)
+                       while ((nlp = strchr(p, '\n')) != NULL)
                        {
                                *nlp = '\0';
                                (void) strcat(obuf, p);
                        {
                                *nlp = '\0';
                                (void) strcat(obuf, p);
index ca4325d..247dc29 100644 (file)
@@ -13,7 +13,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.58 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.59 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        _DEFINE
 #endif /* not lint */
 
 #define        _DEFINE
@@ -81,7 +81,7 @@ ADDRESS               NullAddress =   /* a null address */
 # ifdef SETPROCTITLE
 char           **Argv = NULL;          /* pointer to argument vector */
 char           *LastArgv = NULL;       /* end of argv */
 # ifdef SETPROCTITLE
 char           **Argv = NULL;          /* pointer to argument vector */
 char           *LastArgv = NULL;       /* end of argv */
-# endif SETPROCTITLE
+# endif /* SETPROCTITLE */
 
 /*
 **  The file in which to log raw recipient information.
 
 /*
 **  The file in which to log raw recipient information.
@@ -99,8 +99,8 @@ char          *RcptLogFile = NULL;    /* file name */
 #ifdef DAEMON
 #ifndef SMTP
 ERROR %%%%   Cannot have daemon mode without SMTP   %%%% ERROR
 #ifdef DAEMON
 #ifndef SMTP
 ERROR %%%%   Cannot have daemon mode without SMTP   %%%% ERROR
-#endif SMTP
-#endif DAEMON
+#endif /* SMTP */
+#endif /* DAEMON */
 
 #define MAXCONFIGLEVEL 3       /* highest config version level known */
 
 
 #define MAXCONFIGLEVEL 3       /* highest config version level known */
 
@@ -257,7 +257,7 @@ main(argc, argv, envp)
                LastArgv = envp[i - 1] + strlen(envp[i - 1]);
        else
                LastArgv = argv[argc - 1] + strlen(argv[argc - 1]);
                LastArgv = envp[i - 1] + strlen(envp[i - 1]);
        else
                LastArgv = argv[argc - 1] + strlen(argv[argc - 1]);
-# endif SETPROCTITLE
+# endif /* SETPROCTITLE */
 
        if (signal(SIGINT, SIG_IGN) != SIG_IGN)
                (void) signal(SIGINT, intsig);
 
        if (signal(SIGINT, SIG_IGN) != SIG_IGN)
                (void) signal(SIGINT, intsig);
@@ -318,7 +318,7 @@ main(argc, argv, envp)
        */
 
        av = argv;
        */
 
        av = argv;
-       p = rindex(*av, '/');
+       p = strrchr(*av, '/');
        if (p++ == NULL)
                p = *av;
        if (strcmp(p, "newaliases") == 0)
        if (p++ == NULL)
                p = *av;
        if (strcmp(p, "newaliases") == 0)
@@ -345,13 +345,13 @@ main(argc, argv, envp)
                                usrerr("Daemon mode not implemented");
                                ExitStat = EX_USAGE;
                                break;
                                usrerr("Daemon mode not implemented");
                                ExitStat = EX_USAGE;
                                break;
-# endif DAEMON
+# endif /* DAEMON */
                          case MD_SMTP:
 # ifndef SMTP
                                usrerr("I don't speak SMTP");
                                ExitStat = EX_USAGE;
                                break;
                          case MD_SMTP:
 # ifndef SMTP
                                usrerr("I don't speak SMTP");
                                ExitStat = EX_USAGE;
                                break;
-# endif SMTP
+# endif /* SMTP */
                          case MD_DELIVER:
                          case MD_VERIFY:
                          case MD_TEST:
                          case MD_DELIVER:
                          case MD_VERIFY:
                          case MD_TEST:
@@ -452,10 +452,10 @@ main(argc, argv, envp)
                        FullName = NULL;
                        queuemode = TRUE;
                        QueueIntvl = convtime(&p[2]);
                        FullName = NULL;
                        queuemode = TRUE;
                        QueueIntvl = convtime(&p[2]);
-# else QUEUE
+# else /* QUEUE */
                        usrerr("I don't know about queues");
                        ExitStat = EX_USAGE;
                        usrerr("I don't know about queues");
                        ExitStat = EX_USAGE;
-# endif QUEUE
+# endif /* QUEUE */
                        break;
 
                  case 't':     /* read recipients from message */
                        break;
 
                  case 't':     /* read recipients from message */
@@ -594,10 +594,10 @@ main(argc, argv, envp)
                dropenvelope(CurEnv);
                printqueue();
                exit(EX_OK);
                dropenvelope(CurEnv);
                printqueue();
                exit(EX_OK);
-#else QUEUE
+#else /* QUEUE */
                usrerr("No queue to print");
                finis();
                usrerr("No queue to print");
                finis();
-#endif QUEUE
+#endif /* QUEUE */
 
          case MD_INITALIAS:
                /* initialize alias database */
 
          case MD_INITALIAS:
                /* initialize alias database */
@@ -722,7 +722,7 @@ main(argc, argv, envp)
                runqueue(FALSE);
                finis();
        }
                runqueue(FALSE);
                finis();
        }
-# endif QUEUE
+# endif /* QUEUE */
 
        /*
        **  If a daemon, wait for a request.
 
        /*
        **  If a daemon, wait for a request.
@@ -759,7 +759,7 @@ main(argc, argv, envp)
                                for (;;)
                                        pause();
                }
                                for (;;)
                                        pause();
                }
-# endif QUEUE
+# endif /* QUEUE */
                dropenvelope(CurEnv);
 
 #ifdef DAEMON
                dropenvelope(CurEnv);
 
 #ifdef DAEMON
@@ -769,7 +769,7 @@ main(argc, argv, envp)
                OpMode = MD_SMTP;
                (void) newenvelope(CurEnv);
                openxscript(CurEnv);
                OpMode = MD_SMTP;
                (void) newenvelope(CurEnv);
                openxscript(CurEnv);
-#endif DAEMON
+#endif /* DAEMON */
        }
        
 # ifdef SMTP
        }
        
 # ifdef SMTP
@@ -780,7 +780,7 @@ main(argc, argv, envp)
 
        if (OpMode == MD_SMTP)
                smtp(CurEnv);
 
        if (OpMode == MD_SMTP)
                smtp(CurEnv);
-# endif SMTP
+# endif /* SMTP */
 
        /*
        **  Do basic system initialization and set the sender
 
        /*
        **  Do basic system initialization and set the sender
@@ -874,7 +874,7 @@ finis()
 # ifdef LOG
        if (LogLevel > 11)
                syslog(LOG_DEBUG, "finis, pid=%d", getpid());
 # ifdef LOG
        if (LogLevel > 11)
                syslog(LOG_DEBUG, "finis, pid=%d", getpid());
-# endif LOG
+# endif /* LOG */
        if (ExitStat == EX_TEMPFAIL)
                ExitStat = EX_OK;
        exit(ExitStat);
        if (ExitStat == EX_TEMPFAIL)
                ExitStat = EX_OK;
        exit(ExitStat);
@@ -1197,7 +1197,7 @@ disconnect(fulldrop)
 # ifdef LOG
        if (LogLevel > 11)
                syslog(LOG_DEBUG, "in background, pid=%d", getpid());
 # ifdef LOG
        if (LogLevel > 11)
                syslog(LOG_DEBUG, "in background, pid=%d", getpid());
-# endif LOG
+# endif /* LOG */
 
        errno = 0;
 }
 
        errno = 0;
 }
index 4eed580..2fd5d59 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)parseaddr.c        5.24 (Berkeley) %G%";
+static char sccsid[] = "@(#)parseaddr.c        5.25 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -574,7 +574,7 @@ toktype(c)
                return (ATM);
        if (isspace(c) || c == ')')
                return (SPC);
                return (ATM);
        if (isspace(c) || c == ')')
                return (SPC);
-       if (iscntrl(c) || index(buf, c) != NULL)
+       if (iscntrl(c) || strchr(buf, c) != NULL)
                return (OPR);
        return (ATM);
 }
                return (OPR);
        return (ATM);
 }
index 15c6b5d..0bc3a0e 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef QUEUE
 
 #ifndef lint
 #ifdef QUEUE
-static char sccsid[] = "@(#)queue.c    5.49 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c    5.50 (Berkeley) %G% (with queueing)";
 #else
 #else
-static char sccsid[] = "@(#)queue.c    5.49 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c    5.50 (Berkeley) %G% (without queueing)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -326,7 +326,7 @@ queueup(e, queueall, announce)
        /* save log info */
        if (LogLevel > 15)
                syslog(LOG_DEBUG, "%s: queueup, qf=%s, df=%s\n", e->e_id, qf, e->e_df);
        /* save log info */
        if (LogLevel > 15)
                syslog(LOG_DEBUG, "%s: queueup, qf=%s, df=%s\n", e->e_id, qf, e->e_df);
-# endif LOG
+# endif /* LOG */
        fflush(tfp);
        return;
 }
        fflush(tfp);
        return;
 }
@@ -409,9 +409,9 @@ runqueue(forkflag)
                        /* parent -- pick up intermediate zombie */
 #ifndef SIGCHLD
                        (void) waitfor(pid);
                        /* parent -- pick up intermediate zombie */
 #ifndef SIGCHLD
                        (void) waitfor(pid);
-#else SIGCHLD
+#else /* SIGCHLD */
                        (void) signal(SIGCHLD, reapchild);
                        (void) signal(SIGCHLD, reapchild);
-#endif SIGCHLD
+#endif /* SIGCHLD */
                        if (QueueIntvl != 0)
                                (void) setevent(QueueIntvl, runqueue, TRUE);
                        return;
                        if (QueueIntvl != 0)
                                (void) setevent(QueueIntvl, runqueue, TRUE);
                        return;
@@ -420,9 +420,9 @@ runqueue(forkflag)
 #ifndef SIGCHLD
                if (fork() != 0)
                        exit(EX_OK);
 #ifndef SIGCHLD
                if (fork() != 0)
                        exit(EX_OK);
-#else SIGCHLD
+#else /* SIGCHLD */
                (void) signal(SIGCHLD, SIG_DFL);
                (void) signal(SIGCHLD, SIG_DFL);
-#endif SIGCHLD
+#endif /* SIGCHLD */
        }
 
        setproctitle("running queue: %s", QueueDir);
        }
 
        setproctitle("running queue: %s", QueueDir);
@@ -431,7 +431,7 @@ runqueue(forkflag)
        if (LogLevel > 11)
                syslog(LOG_DEBUG, "runqueue %s, pid=%d, forkflag=%d",
                        QueueDir, getpid(), forkflag);
        if (LogLevel > 11)
                syslog(LOG_DEBUG, "runqueue %s, pid=%d, forkflag=%d",
                        QueueDir, getpid(), forkflag);
-# endif LOG
+# endif /* LOG */
 
        /*
        **  Release any resources used by the daemon code.
 
        /*
        **  Release any resources used by the daemon code.
@@ -439,7 +439,7 @@ runqueue(forkflag)
 
 # ifdef DAEMON
        clrdaemon();
 
 # ifdef DAEMON
        clrdaemon();
-# endif DAEMON
+# endif /* DAEMON */
 
        /*
        **  Create ourselves an envelope
 
        /*
        **  Create ourselves an envelope
@@ -743,7 +743,7 @@ dowork(w, e)
                if (LogLevel > 12)
                        syslog(LOG_DEBUG, "%s: dowork, pid=%d", e->e_id,
                               getpid());
                if (LogLevel > 12)
                        syslog(LOG_DEBUG, "%s: dowork, pid=%d", e->e_id,
                               getpid());
-# endif LOG
+# endif /* LOG */
 
                /* don't use the headers from sendmail.cf... */
                e->e_header = NULL;
 
                /* don't use the headers from sendmail.cf... */
                e->e_header = NULL;
@@ -843,7 +843,7 @@ readqf(e)
                        syslog(LOG_ALERT, "%s: bogus queue file, uid=%d, mode=%o",
                                e->e_id, st.st_uid, st.st_mode);
                }
                        syslog(LOG_ALERT, "%s: bogus queue file, uid=%d, mode=%o",
                                e->e_id, st.st_uid, st.st_mode);
                }
-# endif LOG
+# endif /* LOG */
                fclose(qfp);
                return FALSE;
        }
                fclose(qfp);
                return FALSE;
        }
@@ -862,7 +862,7 @@ readqf(e)
 # ifdef LOG
                if (LogLevel > 10)
                        syslog(LOG_DEBUG, "%s: locked", e->e_id);
 # ifdef LOG
                if (LogLevel > 10)
                        syslog(LOG_DEBUG, "%s: locked", e->e_id);
-# endif LOG
+# endif /* LOG */
                (void) fclose(qfp);
                return FALSE;
        }
                (void) fclose(qfp);
                return FALSE;
        }
@@ -1085,7 +1085,7 @@ printqueue()
        }
 }
 
        }
 }
 
-# endif QUEUE
+# endif /* QUEUE */
 \f/*
 **  QUEUENAME -- build a file name in the queue directory for this envelope.
 **
 \f/*
 **  QUEUENAME -- build a file name in the queue directory for this envelope.
 **
@@ -1185,7 +1185,7 @@ queuename(e, type)
 # ifdef LOG
                if (LogLevel > 16)
                        syslog(LOG_DEBUG, "%s: assigned id", e->e_id);
 # ifdef LOG
                if (LogLevel > 16)
                        syslog(LOG_DEBUG, "%s: assigned id", e->e_id);
-# endif LOG
+# endif /* LOG */
        }
 
        if (type == '\0')
        }
 
        if (type == '\0')
@@ -1220,7 +1220,7 @@ unlockqueue(e)
 # ifdef LOG
        if (LogLevel > 19)
                syslog(LOG_DEBUG, "%s: unlock", e->e_id);
 # ifdef LOG
        if (LogLevel > 19)
                syslog(LOG_DEBUG, "%s: unlock", e->e_id);
-# endif LOG
+# endif /* LOG */
        if (!tTd(51, 4))
                xunlink(queuename(e, 'x'));
 
        if (!tTd(51, 4))
                xunlink(queuename(e, 'x'));
 
index 2142ba8..58b9ef7 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)readcf.c   5.47 (Berkeley) %G%";
+static char sccsid[] = "@(#)readcf.c   5.48 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -142,7 +142,7 @@ readcf(cfname)
                                        /* delete preceeding white space */
                                        while (isspace(*p) && p > buf)
                                                p--;
                                        /* delete preceeding white space */
                                        while (isspace(*p) && p > buf)
                                                p--;
-                                       if ((e = index(++p, '\n')) != NULL)
+                                       if ((e = strchr(++p, '\n')) != NULL)
                                                (void) strcpy(p, e);
                                        else
                                                p[0] = p[1] = '\0';
                                                (void) strcpy(p, e);
                                        else
                                                p[0] = p[1] = '\0';
@@ -424,9 +424,9 @@ fileclass(class, filename, fmt, safe)
                if (sscanf(buf, fmt, wordbuf) != 1)
                        continue;
                p = wordbuf;
                if (sscanf(buf, fmt, wordbuf) != 1)
                        continue;
                p = wordbuf;
-# else SCANF
+# else /* SCANF */
                p = buf;
                p = buf;
-# endif SCANF
+# endif /* SCANF */
 
                /*
                **  Break up the match into words.
 
                /*
                **  Break up the match into words.
@@ -829,7 +829,7 @@ setoption(opt, val, sticky)
                  case SM_QUEUE:        /* queue only */
 #ifndef QUEUE
                        syserr("need QUEUE to set -odqueue");
                  case SM_QUEUE:        /* queue only */
 #ifndef QUEUE
                        syserr("need QUEUE to set -odqueue");
-#endif QUEUE
+#endif /* QUEUE */
                        /* fall through..... */
 
                  case SM_DELIVER:      /* do everything */
                        /* fall through..... */
 
                  case SM_DELIVER:      /* do everything */
index 7799b62..a55e452 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)recipient.c        5.36 (Berkeley) %G%";
+static char sccsid[] = "@(#)recipient.c        5.37 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <sys/types.h>
 #endif /* not lint */
 
 # include <sys/types.h>
@@ -71,8 +71,8 @@ sendto(list, copyf, ctladdr, qflags)
 
        /* heuristic to determine old versus new style addresses */
        if (ctladdr == NULL &&
 
        /* heuristic to determine old versus new style addresses */
        if (ctladdr == NULL &&
-           (index(list, ',') != NULL || index(list, ';') != NULL ||
-            index(list, '<') != NULL || index(list, '(') != NULL))
+           (strchr(list, ',') != NULL || strchr(list, ';') != NULL ||
+            strchr(list, '<') != NULL || strchr(list, '(') != NULL))
                e->e_flags &= ~EF_OLDSTYLE;
        delimiter = ' ';
        if (!bitset(EF_OLDSTYLE, e->e_flags) || ctladdr != NULL)
                e->e_flags &= ~EF_OLDSTYLE;
        delimiter = ' ';
        if (!bitset(EF_OLDSTYLE, e->e_flags) || ctladdr != NULL)
@@ -406,7 +406,7 @@ recipient(a, sendq, e)
                struct stat stb;
                extern bool writable();
 
                struct stat stb;
                extern bool writable();
 
-               p = rindex(buf, '/');
+               p = strrchr(buf, '/');
                /* check if writable or creatable */
                if (a->q_alias == NULL && !QueueRun && !ForceMail)
                {
                /* check if writable or creatable */
                if (a->q_alias == NULL && !QueueRun && !ForceMail)
                {
@@ -566,7 +566,7 @@ finduser(name, fuzzyp)
                char buf[MAXNAME];
 
                fullname(pw, buf);
                char buf[MAXNAME];
 
                fullname(pw, buf);
-               if (index(buf, ' ') != NULL && !strcasecmp(buf, name))
+               if (strchr(buf, ' ') != NULL && !strcasecmp(buf, name))
                {
                        if (tTd(29, 4))
                                printf("fuzzy matches %s\n", pw->pw_name);
                {
                        if (tTd(29, 4))
                                printf("fuzzy matches %s\n", pw->pw_name);
@@ -718,7 +718,7 @@ include(fname, forwarding, ctladdr, sendq, e)
        LineNumber = 0;
        while (fgets(buf, sizeof buf, fp) != NULL)
        {
        LineNumber = 0;
        while (fgets(buf, sizeof buf, fp) != NULL)
        {
-               register char *p = index(buf, '\n');
+               register char *p = strchr(buf, '\n');
 
                LineNumber++;
                if (p != NULL)
 
                LineNumber++;
                if (p != NULL)
index 5b51996..3f9e1e8 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)savemail.c 5.20 (Berkeley) %G%";
+static char sccsid[] = "@(#)savemail.c 5.21 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <sys/types.h>
 #endif /* not lint */
 
 # include <sys/types.h>
@@ -319,7 +319,7 @@ savemail(e)
 # ifdef LOG
                        if (LogLevel >= 1)
                                syslog(LOG_ALERT, "savemail: HELP!!!!");
 # ifdef LOG
                        if (LogLevel >= 1)
                                syslog(LOG_ALERT, "savemail: HELP!!!!");
-# endif LOG
+# endif /* LOG */
 
                        /* leave the locked queue & transcript files around */
                        exit(EX_SOFTWARE);
 
                        /* leave the locked queue & transcript files around */
                        exit(EX_SOFTWARE);
index 4196b8f..7edd706 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)sendmail.h  5.39 (Berkeley) %G%
+ *     @(#)sendmail.h  5.40 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
-static char SmailSccsId[] =    "@(#)sendmail.h 5.39            %G%";
+static char SmailSccsId[] =    "@(#)sendmail.h 5.40            %G%";
 # endif lint
 # endif lint
-# else  _DEFINE
+# else /*  _DEFINE */
 # define EXTERN extern
 # define EXTERN extern
-# endif _DEFINE
+# endif /* _DEFINE */
 
 
-# include <sys/types.h>
+# include <stddef.h>
+# include <stdlib.h>
 # include <stdio.h>
 # include <ctype.h>
 # include <setjmp.h>
 # include <sysexits.h>
 # include <stdio.h>
 # include <ctype.h>
 # include <setjmp.h>
 # include <sysexits.h>
+# include <string.h>
+# include <time.h>
+# include <errno.h>
+
 # include "conf.h"
 # include "conf.h"
 # include "useful.h"
 
 # ifdef LOG
 # include <syslog.h>
 # include "conf.h"
 # include "conf.h"
 # include "useful.h"
 
 # ifdef LOG
 # include <syslog.h>
-# endif LOG
+# endif /* LOG */
 
 # ifdef DAEMON
 # include <sys/socket.h>
 # include <netinet/in.h>
 
 # ifdef DAEMON
 # include <sys/socket.h>
 # include <netinet/in.h>
-# endif DAEMON
+# endif /* DAEMON */
 
 
 # define PSBUFSIZE     (MAXNAME + MAXATOM)     /* size of prescan buffer */
 
 
 # define PSBUFSIZE     (MAXNAME + MAXATOM)     /* size of prescan buffer */
index 6a59c7d..46c63b0 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 5.38 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 5.39 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)srvrsmtp.c 5.38 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 5.39 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -530,7 +530,7 @@ help(topic)
                {
                        register char *p;
 
                {
                        register char *p;
 
-                       p = index(buf, '\t');
+                       p = strchr(buf, '\t');
                        if (p == NULL)
                                p = buf;
                        else
                        if (p == NULL)
                                p = buf;
                        else
@@ -657,4 +657,4 @@ paddrtree(a)
        }
 }
 
        }
 }
 
-# endif SMTP
+# endif /* SMTP */
index b3e511a..e561a3b 100644 (file)
@@ -8,9 +8,9 @@
 
 #ifndef lint
 #ifdef USERDB
 
 #ifndef lint
 #ifdef USERDB
-static char sccsid [] = "@(#)udb.c     5.19 (Berkeley) %G% (with USERDB)";
+static char sccsid [] = "@(#)udb.c     5.20 (Berkeley) %G% (with USERDB)";
 #else
 #else
-static char sccsid [] = "@(#)udb.c     5.19 (Berkeley) %G% (without USERDB)";
+static char sccsid [] = "@(#)udb.c     5.20 (Berkeley) %G% (without USERDB)";
 #endif
 #endif
 
 #endif
 #endif
 
@@ -434,7 +434,7 @@ _udbx_init()
                if (*p == '\0')
                        break;
                spec = p;
                if (*p == '\0')
                        break;
                spec = p;
-               p = index(p, ',');
+               p = strchr(p, ',');
                if (p != NULL)
                        *p++ = '\0';
 
                if (p != NULL)
                        *p++ = '\0';
 
@@ -592,20 +592,20 @@ _udb_parsespec(udbspec, opt, maxopts)
        register char *spec_end;
        register int optnum;
 
        register char *spec_end;
        register int optnum;
 
-       spec_end = index(udbspec, ':');
+       spec_end = strchr(udbspec, ':');
        for (optnum = 0; optnum < maxopts && (spec = spec_end) != NULL; optnum++)
        {
                register char *p;
 
                while (isspace(*spec))
                        spec++;
        for (optnum = 0; optnum < maxopts && (spec = spec_end) != NULL; optnum++)
        {
                register char *p;
 
                while (isspace(*spec))
                        spec++;
-               spec_end = index(spec, ':');
+               spec_end = strchr(spec, ':');
                if (spec_end != NULL)
                        *spec_end++ = '\0';
 
                opt[optnum].name = spec;
                opt[optnum].val = NULL;
                if (spec_end != NULL)
                        *spec_end++ = '\0';
 
                opt[optnum].name = spec;
                opt[optnum].val = NULL;
-               p = index(spec, '=');
+               p = strchr(spec, '=');
                if (p != NULL)
                        opt[optnum].val = ++p;
        }
                if (p != NULL)
                        opt[optnum].val = ++p;
        }
index a9ec09a..26c50da 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)useful.h    4.6 (Berkeley) %G%
+ *     @(#)useful.h    4.7 (Berkeley) %G%
  */
 
 # include <sys/types.h>
  */
 
 # include <sys/types.h>
@@ -16,7 +16,7 @@ typedef char  bool;
 
 # ifndef NULL
 # define NULL  0
 
 # ifndef NULL
 # define NULL  0
-# endif NULL
+# endif /* NULL */
 
 /* bit hacking */
 # define bitset(bit, word)     (((word) & (bit)) != 0)
 
 /* bit hacking */
 # define bitset(bit, word)     (((word) & (bit)) != 0)
@@ -35,23 +35,13 @@ typedef char        bool;
                fprintf(stderr, "assertion botch: %s:%d: ", __FILE__, __LINE__);\
                fprintf(stderr, msg, parm);\
        }
                fprintf(stderr, "assertion botch: %s:%d: ", __FILE__, __LINE__);\
                fprintf(stderr, msg, parm);\
        }
-# else NASSERT
+# else /* NASSERT */
 # define ASSERT(expr, msg, parm)
 # define ASSERT(expr, msg, parm)
-# endif NASSERT
+# endif /* NASSERT */
 
 /* sccs id's */
 # ifndef lint
 # define SCCSID(arg)   static char SccsId[] = "arg";
 
 /* sccs id's */
 # ifndef lint
 # define SCCSID(arg)   static char SccsId[] = "arg";
-# else lint
+# else /* lint */
 # define SCCSID(arg)
 # endif lint
 # define SCCSID(arg)
 # endif lint
-
-/* define the types of some common functions */
-extern char    *strcpy(), *strncpy();
-extern char    *strcat(), *strncat();
-extern char    *malloc();
-extern char    *index(), *rindex();
-extern int     errno;
-extern time_t  time();
-extern char    *ctime();
-extern char    *getenv();
index f8840e7..5a542a7 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)usersmtp.c 5.23 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 5.24 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)usersmtp.c 5.23 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 5.24 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -458,9 +458,9 @@ reply(m, mci, e)
                        if (errno == 0)
 # ifdef ECONNRESET
                                errno = ECONNRESET;
                        if (errno == 0)
 # ifdef ECONNRESET
                                errno = ECONNRESET;
-# else ECONNRESET
+# else /* ECONNRESET */
                                errno = EPIPE;
                                errno = EPIPE;
-# endif ECONNRESET
+# endif /* ECONNRESET */
 
                        message(Arpa_TSyserr, "reply: read error");
                        /* if debugging, pause so we can see state */
 
                        message(Arpa_TSyserr, "reply: read error");
                        /* if debugging, pause so we can see state */
@@ -468,14 +468,14 @@ reply(m, mci, e)
                                pause();
 # ifdef LOG
                        syslog(LOG_INFO, "%s", &MsgBuf[4]);
                                pause();
 # ifdef LOG
                        syslog(LOG_INFO, "%s", &MsgBuf[4]);
-# endif LOG
+# endif /* LOG */
                        mci->mci_state = MCIS_ERROR;
                        smtpquit(m, mci, e);
                        return (-1);
                }
                fixcrlf(SmtpReplyBuffer, TRUE);
 
                        mci->mci_state = MCIS_ERROR;
                        smtpquit(m, mci, e);
                        return (-1);
                }
                fixcrlf(SmtpReplyBuffer, TRUE);
 
-               if (e->e_xfp != NULL && index("45", SmtpReplyBuffer[0]) != NULL)
+               if (e->e_xfp != NULL && strchr("45", SmtpReplyBuffer[0]) != NULL)
                {
                        /* serious error -- log the previous command */
                        if (SmtpMsgBuffer[0] != '\0')
                {
                        /* serious error -- log the previous command */
                        if (SmtpMsgBuffer[0] != '\0')
@@ -545,4 +545,4 @@ smtpmessage(f, m, mci, a, b, c)
                        m == NULL ? "\r\n" : m->m_eol);
 }
 
                        m == NULL ? "\r\n" : m->m_eol);
 }
 
-# endif SMTP
+# endif /* SMTP */
index 6811164..a69a7ac 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)util.c     5.31 (Berkeley) %G%";
+static char sccsid[] = "@(#)util.c     5.32 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <stdio.h>
 #endif /* not lint */
 
 # include <stdio.h>
@@ -117,7 +117,6 @@ xalloc(sz)
        register int sz;
 {
        register char *p;
        register int sz;
 {
        register char *p;
-       extern char *malloc();
 
        p = malloc((unsigned) sz);
        if (p == NULL)
 
        p = malloc((unsigned) sz);
        if (p == NULL)
@@ -429,7 +428,7 @@ fixcrlf(line, stripnl)
 {
        register char *p;
 
 {
        register char *p;
 
-       p = index(line, '\n');
+       p = strchr(line, '\n');
        if (p == NULL)
                return;
        if (p > line && p[-1] == '\r')
        if (p == NULL)
                return;
        if (p > line && p[-1] == '\r')
@@ -518,7 +517,7 @@ putline(l, fp, m)
        do
        {
                /* find the end of the line */
        do
        {
                /* find the end of the line */
-               p = index(l, '\n');
+               p = strchr(l, '\n');
                if (p == NULL)
                        p = &l[strlen(l)];
 
                if (p == NULL)
                        p = &l[strlen(l)];
 
@@ -569,13 +568,13 @@ xunlink(f)
 # ifdef LOG
        if (LogLevel > 20)
                syslog(LOG_DEBUG, "%s: unlink %s\n", CurEnv->e_id, f);
 # ifdef LOG
        if (LogLevel > 20)
                syslog(LOG_DEBUG, "%s: unlink %s\n", CurEnv->e_id, f);
-# endif LOG
+# endif /* LOG */
 
        i = unlink(f);
 # ifdef LOG
        if (i < 0 && LogLevel > 21)
                syslog(LOG_DEBUG, "%s: unlink-fail %d", f, errno);
 
        i = unlink(f);
 # ifdef LOG
        if (i < 0 && LogLevel > 21)
                syslog(LOG_DEBUG, "%s: unlink-fail %d", f, errno);
-# endif LOG
+# endif /* LOG */
 }
 \f/*
 **  SFGETS -- "safe" fgets -- times out and ignores random interrupts.
 }
 \f/*
 **  SFGETS -- "safe" fgets -- times out and ignores random interrupts.
@@ -754,7 +753,7 @@ bool
 atobool(s)
        register char *s;
 {
 atobool(s)
        register char *s;
 {
-       if (*s == '\0' || index("tTyY", *s) != NULL)
+       if (*s == '\0' || strchr("tTyY", *s) != NULL)
                return (TRUE);
        return (FALSE);
 }
                return (TRUE);
        return (FALSE);
 }
index 6d6fde9..82365a5 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)version.c  5.122 (Berkeley) %G%";
+static char sccsid[] = "@(#)version.c  5.123 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
-char   Version[] = "5.122";
+char   Version[] = "5.123";