diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-09-05 15:01:10 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-09-05 15:01:10 +0000 |
commit | f840a7320cb3a4cfdc1082756e842fcb3b350f75 (patch) | |
tree | 76e3e6bc52b99c301d63c4e3a308a8cb60beee2f | |
parent | 9836ccda502d34e1903971f36e2199a7a33175aa (diff) | |
download | fetchmail-f840a7320cb3a4cfdc1082756e842fcb3b350f75.tar.gz fetchmail-f840a7320cb3a4cfdc1082756e842fcb3b350f75.tar.bz2 fetchmail-f840a7320cb3a4cfdc1082756e842fcb3b350f75.zip |
Avoid yet another core dump.
svn path=/trunk/; revision=1305
-rw-r--r-- | driver.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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) |