From 98fa355acfacb0b901f179da8cc2864cce17febc Mon Sep 17 00:00:00 2001 From: chris mikkelson Date: Tue, 23 Feb 2010 20:02:10 -0600 Subject: [PATCH] (Found change from Nov 2, 2009) Handle '\n' line termination in addition to "\r\n". --- smtp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/smtp.c b/smtp.c index 8634a2d..f93172a 100644 --- a/smtp.c +++ b/smtp.c @@ -257,8 +257,14 @@ do_smtp(struct conn *c, char **buf, int *len) char *cmd = *buf; int clen = t - *buf; - if (!t) return 0; - t += 2; + if (t) { + t += 2; + } + else { + t = memchr((void *)*buf, '\n', *len); + if (!t) return 0; + t ++; + } *len -= t - *buf; *buf = t; -- 2.50.1