summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Jung <jung@cvs.openbsd.org>2015-10-27 21:11:28 +0000
committerJoerg Jung <jung@cvs.openbsd.org>2015-10-27 21:11:28 +0000
commit75870e0d1943fb67349510366c28e8c5ea52b571 (patch)
tree04e8a7b225c41502c194057a21003c816456bf62
parent5606155b54a609f19e390c8bb2ea571b08ddfb5f (diff)
delivery lmtp gets fed with a message file as input which is guaranted to have
\n-terminated lines, so no need to strip \r here also remove an unneeded len assignment while here discussed with and ok gilles
-rw-r--r--usr.sbin/smtpd/delivery_lmtp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/smtpd/delivery_lmtp.c b/usr.sbin/smtpd/delivery_lmtp.c
index 7d357bebb2b..dfb3be10908 100644
--- a/usr.sbin/smtpd/delivery_lmtp.c
+++ b/usr.sbin/smtpd/delivery_lmtp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: delivery_lmtp.c,v 1.12 2015/10/19 09:15:35 sunil Exp $ */
+/* $OpenBSD: delivery_lmtp.c,v 1.13 2015/10/27 21:11:27 jung Exp $ */
/*
* Copyright (c) 2013 Ashish SHUKLA <ashish.is@lostca.se>
@@ -128,7 +128,7 @@ lmtp_open(struct deliver *deliver)
if ((fp = fdopen(s, "r+")) == NULL)
err(1, "fdopen");
- if ((len = getline(&buf, &sz, fp)) == -1)
+ if (getline(&buf, &sz, fp) == -1)
err(1, "getline");
if (buf[0] != '2')
@@ -150,9 +150,7 @@ lmtp_open(struct deliver *deliver)
errx(1, "Invalid DATA reply: %s", buf);
while ((len = getline(&buf, &sz, stdin)) != -1) {
- if (len >= 2 && buf[len - 2] == '\r')
- buf[len - 2] = '\0';
- else if (buf[len - 1] == '\n')
+ if (buf[len - 1] == '\n')
buf[len - 1] = '\0';
if (fprintf(fp, "%s%s\r\n", buf[0] == '.' ? "." : "", buf) < 0)