From 9b750142c129356d10667b35ec8a6241429e9c71 Mon Sep 17 00:00:00 2001 From: Chris Mikkelson Date: Thu, 25 Oct 2012 14:17:45 -0500 Subject: [PATCH] Replace FreeBSD-specific strnstr() with memmem() --- smtp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/smtp.c b/smtp.c index d64042b..e6e394e 100644 --- a/smtp.c +++ b/smtp.c @@ -15,6 +15,8 @@ * PERFORMANCE OF THIS SOFTWARE. */ +#define _GNU_SOURCE + #include #include #include @@ -22,6 +24,7 @@ #include #include #include +#include #include #include @@ -270,7 +273,7 @@ do_smtp(struct conn *c, char **buf, int *len) if (c->dstate == 5) return smtpd_enddata(c); return 1; } else { - char *t = strnstr(*buf, "\r\n", *len); + char *t = memmem(*buf, *len, "\r\n", 2); char *cmd = *buf; int clen; -- 2.50.1