Fix incorrect comparison in strcpy_no_crlf
This commit is contained in:
parent
4c117f3e4d
commit
6f0d71a07b
|
@ -18,7 +18,7 @@ static char *strcpy_no_crlf(char *dest, const char *src) {
|
||||||
char *last_dest_cursor = NULL;
|
char *last_dest_cursor = NULL;
|
||||||
const char *last_src_cursor = NULL;
|
const char *last_src_cursor = NULL;
|
||||||
for (dest_cursor = dest, src_cursor = src; *src_cursor != '\0'; src_cursor++) {
|
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.
|
// Replace the \r with a null term.
|
||||||
*last_dest_cursor = '\0';
|
*last_dest_cursor = '\0';
|
||||||
return dest;
|
return dest;
|
||||||
|
|
Loading…
Reference in a new issue