From e375867f690a8200a807b8f98a09fbe97cec41be Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 6 Nov 2025 10:12:03 +0100 Subject: [PATCH 1/3] Fix for crash in debug mode in macos when reading windows stlye line ending --- lib_util/cmdl_tools.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib_util/cmdl_tools.c b/lib_util/cmdl_tools.c index bec772ce4..900e003aa 100644 --- a/lib_util/cmdl_tools.c +++ b/lib_util/cmdl_tools.c @@ -185,20 +185,21 @@ 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; } - /*---------------------------------------------------------------------* * clearString() * -- GitLab From f561b72f6815382a9eced09f6aea2f2f77fbf285 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 6 Nov 2025 10:17:08 +0100 Subject: [PATCH 2/3] clang format --- lib_util/cmdl_tools.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_util/cmdl_tools.c b/lib_util/cmdl_tools.c index 900e003aa..945bda07d 100644 --- a/lib_util/cmdl_tools.c +++ b/lib_util/cmdl_tools.c @@ -194,9 +194,9 @@ void remove_cr( str[p] = c; p += ( c == '\r' ) ? 0 : 1; } - + str[p] = 0; - + return; } -- GitLab From 71fadc9f00bc00cf6bed3dd508a3f349aa47db72 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 6 Nov 2025 10:29:42 +0100 Subject: [PATCH 3/3] Dummy commit -- GitLab