From 8dc4c8338aa1ed295ae523130bbc95bfa7019692 Mon Sep 17 00:00:00 2001 From: Gaurav Aggarwal Date: Thu, 19 Dec 2024 18:36:05 +0000 Subject: [PATCH] Use strlen instead of sizeof. This allows using pointer to string for configIDLE_TASK_NAME. Coverage tests do that. Signed-off-by: Gaurav Aggarwal --- tasks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.c b/tasks.c index 013694dd34..f6af37bab8 100644 --- a/tasks.c +++ b/tasks.c @@ -3535,7 +3535,7 @@ static BaseType_t prvCreateIdleTasks( void ) /* The length of the idle task name is limited to the minimum of the length * of configIDLE_TASK_NAME and configMAX_TASK_NAME_LEN - 2, keeping space * for the core ID suffix and the null-terminator. */ - xIdleNameLen = sizeof( configIDLE_TASK_NAME ) - 1; + xIdleNameLen = strlen( configIDLE_TASK_NAME ); xCopyLen = xIdleNameLen < ( configMAX_TASK_NAME_LEN - 2 ) ? xIdleNameLen : ( configMAX_TASK_NAME_LEN - 2 ); for( xIdleTaskNameIndex = ( BaseType_t ) 0; xIdleTaskNameIndex < xCopyLen; xIdleTaskNameIndex++ )