change call to expand() to be more rational (and consistent!)
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 15 Mar 1995 01:11:22 +0000 (17:11 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 15 Mar 1995 01:11:22 +0000 (17:11 -0800)
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 8.38
SCCS-vsn: usr.sbin/sendmail/src/headers.c 8.50
SCCS-vsn: usr.sbin/sendmail/src/macro.c 8.10
SCCS-vsn: usr.sbin/sendmail/src/main.c 8.91
SCCS-vsn: usr.sbin/sendmail/src/envelope.c 8.52
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 8.58
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 8.103
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 8.56
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 8.74
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 8.56
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 8.74
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 8.130
SCCS-vsn: usr.sbin/sendmail/src/queue.c 8.68
SCCS-vsn: usr.sbin/sendmail/src/alias.c 8.39

14 files changed:
usr/src/usr.sbin/sendmail/src/alias.c
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/headers.c
usr/src/usr.sbin/sendmail/src/macro.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/savemail.c
usr/src/usr.sbin/sendmail/src/sendmail.h
usr/src/usr.sbin/sendmail/src/srvrsmtp.c
usr/src/usr.sbin/sendmail/src/usersmtp.c

index 7dc0e96..ff6f37a 100644 (file)
@@ -10,7 +10,7 @@
 # include <pwd.h>
 
 #ifndef lint
 # include <pwd.h>
 
 #ifndef lint
-static char sccsid[] = "@(#)alias.c    8.38 (Berkeley) %G%";
+static char sccsid[] = "@(#)alias.c    8.39 (Berkeley) %G%";
 #endif /* not lint */
 
 
 #endif /* not lint */
 
 
@@ -808,7 +808,7 @@ forward(user, sendq, aliaslevel, e)
                ep = strchr(pp, ':');
                if (ep != NULL)
                        *ep = '\0';
                ep = strchr(pp, ':');
                if (ep != NULL)
                        *ep = '\0';
-               expand(pp, buf, &buf[sizeof buf - 1], e);
+               expand(pp, buf, sizeof buf, e);
                if (ep != NULL)
                        *ep++ = ':';
                if (tTd(27, 3))
                if (ep != NULL)
                        *ep++ = ':';
                if (tTd(27, 3))
index e90a7f4..9380707 100644 (file)
@@ -12,9 +12,9 @@
 
 #ifndef lint
 #ifdef DAEMON
 
 #ifndef lint
 #ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c   8.73 (Berkeley) %G% (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c   8.74 (Berkeley) %G% (with daemon mode)";
 #else
 #else
-static char sccsid[] = "@(#)daemon.c   8.73 (Berkeley) %G% (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c   8.74 (Berkeley) %G% (without daemon mode)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -148,7 +148,7 @@ getrequests()
        {
                char jbuf[MAXHOSTNAMELEN];
 
        {
                char jbuf[MAXHOSTNAMELEN];
 
-               expand("\201j", jbuf, &jbuf[sizeof jbuf - 1], CurEnv);
+               expand("\201j", jbuf, sizeof jbuf, CurEnv);
                j_has_dot = strchr(jbuf, '.') != NULL;
        }
 #endif
                j_has_dot = strchr(jbuf, '.') != NULL;
        }
 #endif
index aaa8704..831fe2c 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)deliver.c  8.129 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c  8.130 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -752,7 +752,7 @@ deliver(e, firstto)
                        break;
 
                /* this entry is safe -- go ahead and process it */
                        break;
 
                /* this entry is safe -- go ahead and process it */
-               expand(*mvp, buf, &buf[sizeof buf], e);
+               expand(*mvp, buf, sizeof buf, e);
                *pvp++ = newstr(buf);
                if (pvp >= &pv[MAXPV - 3])
                {
                *pvp++ = newstr(buf);
                if (pvp >= &pv[MAXPV - 3])
                {
@@ -938,7 +938,7 @@ deliver(e, firstto)
 
                if (!clever)
                {
 
                if (!clever)
                {
-                       expand(*mvp, buf, &buf[sizeof buf], e);
+                       expand(*mvp, buf, sizeof buf, e);
                        *pvp++ = newstr(buf);
                        if (pvp >= &pv[MAXPV - 2])
                        {
                        *pvp++ = newstr(buf);
                        if (pvp >= &pv[MAXPV - 2])
                        {
@@ -964,7 +964,7 @@ deliver(e, firstto)
 
        while (!clever && *++mvp != NULL)
        {
 
        while (!clever && *++mvp != NULL)
        {
-               expand(*mvp, buf, &buf[sizeof buf], e);
+               expand(*mvp, buf, sizeof buf, e);
                *pvp++ = newstr(buf);
                if (pvp >= &pv[MAXPV])
                        syserr("554 deliver: pv overflow after $u for %s", pv[0]);
                *pvp++ = newstr(buf);
                if (pvp >= &pv[MAXPV])
                        syserr("554 deliver: pv overflow after $u for %s", pv[0]);
@@ -1300,7 +1300,7 @@ tryhost:
                                        q = strchr(p, ':');
                                        if (q != NULL)
                                                *q = '\0';
                                        q = strchr(p, ':');
                                        if (q != NULL)
                                                *q = '\0';
-                                       expand(p, buf, &buf[sizeof buf], e);
+                                       expand(p, buf, sizeof buf, e);
                                        if (q != NULL)
                                                *q++ = ':';
                                        if (tTd(11, 20))
                                        if (q != NULL)
                                                *q++ = ':';
                                        if (tTd(11, 20))
@@ -2195,7 +2195,7 @@ putfromline(mci, e)
                char *bang;
                char xbuf[MAXLINE];
 
                char *bang;
                char xbuf[MAXLINE];
 
-               expand("\201g", buf, &buf[sizeof buf - 1], e);
+               expand("\201g", buf, sizeof buf, e);
                bang = strchr(buf, '!');
                if (bang == NULL)
                {
                bang = strchr(buf, '!');
                if (bang == NULL)
                {
@@ -2210,7 +2210,7 @@ putfromline(mci, e)
                }
        }
 # endif /* UGLYUUCP */
                }
        }
 # endif /* UGLYUUCP */
-       expand(template, buf, &buf[sizeof buf - 1], e);
+       expand(template, buf, sizeof buf, e);
        putxline(buf, mci, FALSE);
 }
 \f/*
        putxline(buf, mci, FALSE);
 }
 \f/*
index 022c678..c0ad199 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)envelope.c 8.51 (Berkeley) %G%";
+static char sccsid[] = "@(#)envelope.c 8.52 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -686,7 +686,7 @@ setsender(from, e, delimptr, internal)
                        char nbuf[100];
 
                        SuprErrs = TRUE;
                        char nbuf[100];
 
                        SuprErrs = TRUE;
-                       expand("\201n", nbuf, &nbuf[sizeof nbuf], e);
+                       expand("\201n", nbuf, sizeof nbuf, e);
                        if (parseaddr(from = newstr(nbuf), &e->e_from,
                                      RF_COPYALL, ' ', NULL, e) == NULL &&
                            parseaddr(from = "postmaster", &e->e_from,
                        if (parseaddr(from = newstr(nbuf), &e->e_from,
                                      RF_COPYALL, ' ', NULL, e) == NULL &&
                            parseaddr(from = "postmaster", &e->e_from,
index ab66115..1e62d70 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)headers.c  8.49 (Berkeley) %G%";
+static char sccsid[] = "@(#)headers.c  8.50 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <errno.h>
 #endif /* not lint */
 
 # include <errno.h>
@@ -164,7 +164,7 @@ chompheader(line, def, e)
                                char *oldg = macvalue('g', e);
 
                                define('g', p, e);
                                char *oldg = macvalue('g', e);
 
                                define('g', p, e);
-                               expand(fancy, buf, &buf[sizeof buf], e);
+                               expand(fancy, buf, sizeof buf, e);
                                define('g', oldg, e);
                                fvalue = buf;
                        }
                                define('g', oldg, e);
                                fvalue = buf;
                        }
@@ -387,7 +387,7 @@ eatheader(e, full)
                /* do early binding */
                if (bitset(H_DEFAULT, h->h_flags))
                {
                /* do early binding */
                if (bitset(H_DEFAULT, h->h_flags))
                {
-                       expand(h->h_value, buf, &buf[sizeof buf], e);
+                       expand(h->h_value, buf, sizeof buf, e);
                        if (buf[0] != '\0')
                        {
                                h->h_value = newstr(buf);
                        if (buf[0] != '\0')
                        {
                                h->h_value = newstr(buf);
@@ -1001,7 +1001,7 @@ putheader(mci, h, e)
                p = h->h_value;
                if (bitset(H_DEFAULT, h->h_flags))
                {
                p = h->h_value;
                if (bitset(H_DEFAULT, h->h_flags))
                {
-                       expand(p, buf, &buf[sizeof buf], e);
+                       expand(p, buf, sizeof buf, e);
                        p = buf;
                        if (p == NULL || *p == '\0')
                        {
                        p = buf;
                        if (p == NULL || *p == '\0')
                        {
index 6a3adc4..3c017df 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)macro.c    8.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)macro.c    8.10 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -23,8 +23,7 @@ int   NextMacroId = 0240;     /* codes for long named macros */
 **     Parameters:
 **             s -- the string to expand.
 **             buf -- the place to put the expansion.
 **     Parameters:
 **             s -- the string to expand.
 **             buf -- the place to put the expansion.
-**             buflim -- the buffer limit, i.e., the address
-**                     of the first byte after buf.
+**             bufsize -- the size of the buffer.
 **             e -- envelope in which to work.
 **
 **     Returns:
 **             e -- envelope in which to work.
 **
 **     Returns:
@@ -35,10 +34,10 @@ int NextMacroId = 0240;     /* codes for long named macros */
 */
 
 void
 */
 
 void
-expand(s, buf, buflim, e)
+expand(s, buf, bufsize, e)
        register char *s;
        register char *buf;
        register char *s;
        register char *buf;
-       char *buflim;
+       size_t bufsize;
        register ENVELOPE *e;
 {
        register char *xp;
        register ENVELOPE *e;
 {
        register char *xp;
@@ -139,14 +138,14 @@ expand(s, buf, buflim, e)
        /* recurse as appropriate */
        if (recurse)
        {
        /* recurse as appropriate */
        if (recurse)
        {
-               expand(xbuf, buf, buflim, e);
+               expand(xbuf, buf, bufsize, e);
                return;
        }
 
        /* copy results out */
                return;
        }
 
        /* copy results out */
-       i = buflim - buf - 1;
-       if (i > xp - xbuf)
-               i = xp - xbuf;
+       i = xp - xbuf;
+       if (i >= bufsize)
+               i = bufsize - 1;
        bcopy(xbuf, buf, i);
        buf[i] = '\0';
 }
        bcopy(xbuf, buf, i);
        buf[i] = '\0';
 }
index 0fb5cf6..b9c60ec 100644 (file)
@@ -13,7 +13,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     8.90 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     8.91 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        _DEFINE
 #endif /* not lint */
 
 #define        _DEFINE
@@ -757,7 +757,7 @@ main(argc, argv, envp)
        }
 
        /* our name for SMTP codes */
        }
 
        /* our name for SMTP codes */
-       expand("\201j", jbuf, &jbuf[sizeof jbuf - 1], CurEnv);
+       expand("\201j", jbuf, sizeof jbuf, CurEnv);
        MyHostName = jbuf;
        if (strchr(jbuf, '.') == NULL)
                message("WARNING: local host name (%s) is not qualified; fix $j in config file",
        MyHostName = jbuf;
        if (strchr(jbuf, '.') == NULL)
                message("WARNING: local host name (%s) is not qualified; fix $j in config file",
index 44bcbdb..f3fe77b 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)parseaddr.c        8.57 (Berkeley) %G%";
+static char sccsid[] = "@(#)parseaddr.c        8.58 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -435,7 +435,7 @@ prescan(addr, delim, pvpbuf, pvpbsize, delimptr)
                char obuf[50];
 
                firsttime = FALSE;
                char obuf[50];
 
                firsttime = FALSE;
-               expand("\201o", obuf, &obuf[sizeof obuf - sizeof DELIMCHARS], CurEnv);
+               expand("\201o", obuf, sizeof obuf - sizeof DELIMCHARS, CurEnv);
                strcat(obuf, DELIMCHARS);
                for (p = obuf; *p != '\0'; p++)
                {
                strcat(obuf, DELIMCHARS);
                for (p = obuf; *p != '\0'; p++)
                {
@@ -2121,9 +2121,9 @@ remotename(name, m, flags, pstat, e)
 
        /* need to make sure route-addrs have <angle brackets> */
        if (bitset(RF_CANONICAL, flags) && lbuf[0] == '@')
 
        /* need to make sure route-addrs have <angle brackets> */
        if (bitset(RF_CANONICAL, flags) && lbuf[0] == '@')
-               expand("<\201g>", buf, &buf[sizeof buf], e);
+               expand("<\201g>", buf, sizeof buf, e);
        else
        else
-               expand(fancy, buf, &buf[sizeof buf], e);
+               expand(fancy, buf, sizeof buf, e);
 
        define('g', oldg, e);
 
 
        define('g', oldg, e);
 
index a8e3702..0480576 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef QUEUE
 
 #ifndef lint
 #ifdef QUEUE
-static char sccsid[] = "@(#)queue.c    8.67 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c    8.68 (Berkeley) %G% (with queueing)";
 #else
 #else
-static char sccsid[] = "@(#)queue.c    8.67 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c    8.68 (Berkeley) %G% (without queueing)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -315,7 +315,7 @@ queueup(e, queueall, announce)
                /* expand macros; if null, don't output header at all */
                if (bitset(H_DEFAULT, h->h_flags))
                {
                /* expand macros; if null, don't output header at all */
                if (bitset(H_DEFAULT, h->h_flags))
                {
-                       (void) expand(h->h_value, buf, &buf[sizeof buf], e);
+                       (void) expand(h->h_value, buf, sizeof buf, e);
                        if (buf[0] == '\0')
                                continue;
                }
                        if (buf[0] == '\0')
                                continue;
                }
index 4053640..413a85c 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)readcf.c   8.73 (Berkeley) %G%";
+static char sccsid[] = "@(#)readcf.c   8.74 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -221,7 +221,7 @@ readcf(cfname)
 
                        /* expand and save the LHS */
                        *p = '\0';
 
                        /* expand and save the LHS */
                        *p = '\0';
-                       expand(&bp[1], exbuf, &exbuf[sizeof exbuf], e);
+                       expand(&bp[1], exbuf, sizeof exbuf, e);
                        rwp->r_lhs = prescan(exbuf, '\t', pvpbuf,
                                             sizeof pvpbuf, NULL);
                        nfuzzy = 0;
                        rwp->r_lhs = prescan(exbuf, '\t', pvpbuf,
                                             sizeof pvpbuf, NULL);
                        nfuzzy = 0;
@@ -309,7 +309,7 @@ readcf(cfname)
                        while (*p != '\0' && *p != '\t')
                                p++;
                        *p = '\0';
                        while (*p != '\0' && *p != '\t')
                                p++;
                        *p = '\0';
-                       expand(q, exbuf, &exbuf[sizeof exbuf], e);
+                       expand(q, exbuf, sizeof exbuf, e);
                        rwp->r_rhs = prescan(exbuf, '\t', pvpbuf,
                                             sizeof pvpbuf, NULL);
                        if (rwp->r_rhs != NULL)
                        rwp->r_rhs = prescan(exbuf, '\t', pvpbuf,
                                             sizeof pvpbuf, NULL);
                        if (rwp->r_rhs != NULL)
@@ -439,7 +439,7 @@ readcf(cfname)
                        if (bp[0] == 'C')
                        {
                                mid = macid(&bp[1], &ep);
                        if (bp[0] == 'C')
                        {
                                mid = macid(&bp[1], &ep);
-                               expand(ep, exbuf, &exbuf[sizeof exbuf], e);
+                               expand(ep, exbuf, sizeof exbuf, e);
                                p = exbuf;
                        }
                        else
                                p = exbuf;
                        }
                        else
index 2721633..5cfa6e8 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)savemail.c 8.55 (Berkeley) %G%";
+static char sccsid[] = "@(#)savemail.c 8.56 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -183,7 +183,7 @@ savemail(e, sendbody)
                                break;
                        }
 
                                break;
                        }
 
-                       expand("\201n", buf, &buf[sizeof buf - 1], e);
+                       expand("\201n", buf, sizeof buf, e);
                        printf("\r\nMessage from %s...\r\n", buf);
                        printf("Errors occurred while sending mail.\r\n");
                        if (e->e_xfp != NULL)
                        printf("\r\nMessage from %s...\r\n", buf);
                        printf("Errors occurred while sending mail.\r\n");
                        if (e->e_xfp != NULL)
@@ -324,7 +324,7 @@ savemail(e, sendbody)
 
                                /* we have a home directory; open dead.letter */
                                define('z', p, e);
 
                                /* we have a home directory; open dead.letter */
                                define('z', p, e);
-                               expand("\201z/dead.letter", buf, &buf[sizeof buf - 1], e);
+                               expand("\201z/dead.letter", buf, sizeof buf, e);
                                Verbose = TRUE;
                                message("Saving message in %s", buf);
                                Verbose = oldverb;
                                Verbose = TRUE;
                                message("Saving message in %s", buf);
                                Verbose = oldverb;
@@ -528,7 +528,7 @@ returntosender(msg, returnq, sendbody, e)
        addheader("Subject", msg, ee);
 
        /* fake up an address header for the from person */
        addheader("Subject", msg, ee);
 
        /* fake up an address header for the from person */
-       expand("\201n", buf, &buf[sizeof buf - 1], e);
+       expand("\201n", buf, sizeof buf, e);
        if (parseaddr(buf, &ee->e_from, RF_COPYALL|RF_SENDERADDR, '\0', NULL, e) == NULL)
        {
                syserr("553 Can't parse myself!");
        if (parseaddr(buf, &ee->e_from, RF_COPYALL|RF_SENDERADDR, '\0', NULL, e) == NULL)
        {
                syserr("553 Can't parse myself!");
@@ -637,7 +637,7 @@ errbody(mci, e, separator)
        sprintf(buf, "The original message was received at %s",
                arpadate(ctime(&e->e_parent->e_ctime)));
        putline(buf, mci);
        sprintf(buf, "The original message was received at %s",
                arpadate(ctime(&e->e_parent->e_ctime)));
        putline(buf, mci);
-       expand("from \201_", buf, &buf[sizeof buf - 1], e->e_parent);
+       expand("from \201_", buf, sizeof buf, e->e_parent);
        putline(buf, mci);
        putline("", mci);
 
        putline(buf, mci);
        putline("", mci);
 
@@ -654,7 +654,7 @@ errbody(mci, e, separator)
                        {
                                while (fgets(buf, sizeof buf, xfile) != NULL)
                                {
                        {
                                while (fgets(buf, sizeof buf, xfile) != NULL)
                                {
-                                       expand(buf, buf, &buf[sizeof buf - 1], e);
+                                       expand(buf, buf, sizeof buf, e);
                                        putline(buf, mci);
                                }
                                (void) fclose(xfile);
                                        putline(buf, mci);
                                }
                                (void) fclose(xfile);
@@ -663,7 +663,7 @@ errbody(mci, e, separator)
                }
                else
                {
                }
                else
                {
-                       expand(ErrMsgFile, buf, &buf[sizeof buf - 1], e);
+                       expand(ErrMsgFile, buf, sizeof buf, e);
                        putline(buf, mci);
                        putline("", mci);
                }
                        putline(buf, mci);
                        putline("", mci);
                }
index 3adeaad..7201b3f 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)sendmail.h  8.102 (Berkeley) %G%
+ *     @(#)sendmail.h  8.103 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -15,7 +15,7 @@
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
-static char SmailSccsId[] =    "@(#)sendmail.h 8.102           %G%";
+static char SmailSccsId[] =    "@(#)sendmail.h 8.103           %G%";
 # endif
 # else /*  _DEFINE */
 # define EXTERN extern
 # endif
 # else /*  _DEFINE */
 # define EXTERN extern
@@ -1054,7 +1054,7 @@ extern char               *queuename __P((ENVELOPE *, int));
 extern time_t          curtime __P(());
 extern bool            transienterror __P((int));
 extern const char      *errstring __P((int));
 extern time_t          curtime __P(());
 extern bool            transienterror __P((int));
 extern const char      *errstring __P((int));
-extern void            expand __P((char *, char *, char *, ENVELOPE *));
+extern void            expand __P((char *, char *, size_t, ENVELOPE *));
 extern void            define __P((int, char *, ENVELOPE *));
 extern char            *macvalue __P((int, ENVELOPE *));
 extern char            *macname __P((int));
 extern void            define __P((int, char *, ENVELOPE *));
 extern char            *macvalue __P((int, ENVELOPE *));
 extern char            *macname __P((int));
index bf7e409..8a0d0bd 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 8.55 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.56 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)srvrsmtp.c 8.55 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.56 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -124,7 +124,7 @@ smtp(e)
                CurSmtpClient = CurHostName;
 
        setproctitle("server %s startup", CurSmtpClient);
                CurSmtpClient = CurHostName;
 
        setproctitle("server %s startup", CurSmtpClient);
-       expand("\201e", inp, &inp[sizeof inp], e);
+       expand("\201e", inp, sizeof inp, e);
        if (BrokenSmtpPeers)
        {
                p = strchr(inp, '\n');
        if (BrokenSmtpPeers)
        {
                p = strchr(inp, '\n');
index 51a354b..3594529 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)usersmtp.c 8.37 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.38 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)usersmtp.c 8.37 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.38 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -387,7 +387,7 @@ smtpmailfrom(m, mci, e)
            !bitnset(M_NO_NULL_FROM, m->m_flags))
                (void) strcpy(buf, "");
        else
            !bitnset(M_NO_NULL_FROM, m->m_flags))
                (void) strcpy(buf, "");
        else
-               expand("\201g", buf, &buf[sizeof buf], e);
+               expand("\201g", buf, sizeof buf, e);
        if (buf[0] == '<')
        {
                /* strip off <angle brackets> (put back on below) */
        if (buf[0] == '<')
        {
                /* strip off <angle brackets> (put back on below) */