aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-09-05 15:01:10 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-09-05 15:01:10 +0000
commitf840a7320cb3a4cfdc1082756e842fcb3b350f75 (patch)
tree76e3e6bc52b99c301d63c4e3a308a8cb60beee2f
parent9836ccda502d34e1903971f36e2199a7a33175aa (diff)
downloadfetchmail-f840a7320cb3a4cfdc1082756e842fcb3b350f75.tar.gz
fetchmail-f840a7320cb3a4cfdc1082756e842fcb3b350f75.tar.bz2
fetchmail-f840a7320cb3a4cfdc1082756e842fcb3b350f75.zip
Avoid yet another core dump.
svn path=/trunk/; revision=1305
-rw-r--r--driver.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/driver.c b/driver.c
index 722f76e9..d6ea0a9e 100644
--- a/driver.c
+++ b/driver.c
@@ -866,7 +866,7 @@ int num; /* index of message */
}
else
{
- char *ap, *ctt, options[MSGBUFSIZE], addr[128];
+ char *ap, *ctt, options[MSGBUFSIZE], addr[128], *desthost;
/* build a connection to the SMTP listener */
if ((smtp_open(ctl) == -1))
@@ -991,13 +991,14 @@ int num; /* index of message */
* or MX but not a CNAME. Some listeners (like exim)
* enforce this.
*/
+ desthost = ctl->smtphost ? ctl->smtphost : "localhost";
for (idp = xmit_names; idp; idp = idp->next)
if (idp->val.num == XMIT_ACCEPT)
{
#ifdef HAVE_SNPRINTF
- snprintf(addr, sizeof(addr)-1, "%s@%s", idp->id,ctl->smtphost);
+ snprintf(addr, sizeof(addr)-1, "%s@%s", idp->id, desthost);
#else
- sprintf(addr, "%s@%s", idp->id, ctl->smtphost);
+ sprintf(addr, "%s@%s", idp->id, desthost);
#endif /* HAVE_SNPRINTF */
if (SMTP_rcpt(ctl->smtp_socket, addr) == SM_OK)
@@ -1013,9 +1014,9 @@ int num; /* index of message */
if (!good_addresses)
{
#ifdef HAVE_SNPRINTF
- snprintf(addr, sizeof(addr)-1, "%s@%s", idp->id, ctl->smtphost);
+ snprintf(addr, sizeof(addr)-1, "%s@%s", idp->id, desthost);
#else
- sprintf(addr, "%s@%s", idp->id, ctl->smtphost);
+ sprintf(addr, "%s@%s", idp->id, desthost);
#endif /* HAVE_SNPRINTF */
if (SMTP_rcpt(ctl->smtp_socket, user) != SM_OK)