From: chris mikkelson Date: Wed, 24 Feb 2010 02:02:10 +0000 (-0600) Subject: (Found change from Nov 2, 2009) X-Git-Url: https://git.mikk.net/?a=commitdiff_plain;h=98fa355acfacb0b901f179da8cc2864cce17febc;p=smtpsink (Found change from Nov 2, 2009) Handle '\n' line termination in addition to "\r\n". --- 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;