Commit 569faa30 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

Merge branch '1414_fix_crash_debug_macos_cr' into 'main'

Fix for crash in debug mode in macos when reading windows style line ending

See merge request !2293
parents ce3afad1 0b70a383
Loading
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -185,16 +185,16 @@ void convert_backslash(
void remove_cr(
    char *str )
{
    char *pos;
    int32_t n, p = 0;

    /* remove all \r characters from the string */
    pos = strchr( str, '\r' );
    while ( pos != NULL )
    for ( n = 0; str[n] != 0; n++ )
    {
        strcpy( pos, pos + 1 );
        pos = strchr( pos, '\r' );
        char c = str[n];
        str[p] = c;
        p += ( c == '\r' ) ? 0 : 1;
    }

    str[p] = 0;
    return;
}