summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/lka_session.c
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2012-07-29 16:33:02 +0000
committerEric Faurot <eric@cvs.openbsd.org>2012-07-29 16:33:02 +0000
commit04da5a8af0f210ddec600baed1f0ddcb32e36172 (patch)
tree20e463c116b45405fc138633e0bf9ce141978f60 /usr.sbin/smtpd/lka_session.c
parent2f8c1cea3ab557bdcfc2db8904c166a161882ddc (diff)
get rid of A_INVALID.
little code cleanup while here. ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/lka_session.c')
-rw-r--r--usr.sbin/smtpd/lka_session.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/usr.sbin/smtpd/lka_session.c b/usr.sbin/smtpd/lka_session.c
index 87fc63f8f76..b0b1423ad21 100644
--- a/usr.sbin/smtpd/lka_session.c
+++ b/usr.sbin/smtpd/lka_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lka_session.c,v 1.17 2012/07/12 08:51:43 chl Exp $ */
+/* $OpenBSD: lka_session.c,v 1.18 2012/07/29 16:33:01 eric Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org>
@@ -379,27 +379,20 @@ void
lka_session_deliver(struct lka_session *lks, struct envelope *ep)
{
struct envelope *new_ep;
- struct delivery_mda *d_mda;
new_ep = calloc(1, sizeof (*ep));
if (new_ep == NULL)
fatal("lka_session_deliver: calloc");
*new_ep = *ep;
if (new_ep->type == D_MDA) {
- d_mda = &new_ep->agent.mda;
- if (d_mda->method == A_INVALID)
- fatalx("lka_session_deliver: mda method == A_INVALID");
-
- switch (d_mda->method) {
+ switch (new_ep->agent.mda.method) {
case A_MAILDIR:
case A_FILENAME:
- case A_MDA: {
- char *buf = d_mda->to.buffer;
- size_t bufsz = sizeof(d_mda->to.buffer);
- if (! lka_session_expand_format(buf, bufsz, new_ep))
+ case A_MDA:
+ if (! lka_session_expand_format(
+ new_ep->agent.mda.to.buffer,
+ sizeof(new_ep->agent.mda.to.buffer), new_ep))
lks->flags |= F_ERROR;
- break;
- }
default:
break;
}