Fix incorrect comparison in strcpy_no_crlf

master
Nick Krichevsky 2018-09-09 23:14:08 -04:00
parent 4c117f3e4d
commit 6f0d71a07b
1 changed files with 1 additions and 1 deletions

View File

@ -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;