From 6f0d71a07b2b7a8afbf1fc14a8d530fb3b912c3f Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Sun, 9 Sep 2018 23:14:08 -0400 Subject: [PATCH] Fix incorrect comparison in strcpy_no_crlf --- server/request_handling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/request_handling.c b/server/request_handling.c index 110c625..86517ce 100644 --- a/server/request_handling.c +++ b/server/request_handling.c @@ -18,7 +18,7 @@ static char *strcpy_no_crlf(char *dest, const char *src) { char *last_dest_cursor = NULL; const char *last_src_cursor = NULL; for (dest_cursor = dest, src_cursor = src; *src_cursor != '\0'; src_cursor++) { - if (last_src_cursor != NULL && *last_src_cursor == '\r' && *last_src_cursor == '\n') { + if (last_src_cursor != NULL && *last_src_cursor == '\r' && *src_cursor == '\n') { // Replace the \r with a null term. *last_dest_cursor = '\0'; return dest;