$d is current date, not origination date
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 22 Feb 1993 06:12:15 +0000 (22:12 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 22 Feb 1993 06:12:15 +0000 (22:12 -0800)
SCCS-vsn: usr.sbin/sendmail/src/envelope.c 6.11

usr/src/usr.sbin/sendmail/src/envelope.c

index a596cbb..0ae656a 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)envelope.c 6.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)envelope.c 6.11 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -322,9 +322,10 @@ settime(e)
                        tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min);
        define('t', tbuf, e);
        (void) strcpy(dbuf, ctime(&now));
                        tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min);
        define('t', tbuf, e);
        (void) strcpy(dbuf, ctime(&now));
-       *strchr(dbuf, '\n') = '\0';
-       if (macvalue('d', e) == NULL)
-               define('d', dbuf, e);
+       p = strchr(dbuf, '\n');
+       if (p != NULL)
+               *p = '\0';
+       define('d', dbuf, e);
        p = newstr(arpadate(dbuf));
        if (macvalue('a', e) == NULL)
                define('a', p, e);
        p = newstr(arpadate(dbuf));
        if (macvalue('a', e) == NULL)
                define('a', p, e);