Use strlen instead of sizeof.

This allows using pointer to string for configIDLE_TASK_NAME. Coverage
tests do that.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
Gaurav Aggarwal 2024-12-19 18:36:05 +00:00
parent 2dfe9e6832
commit 8dc4c8338a

View file

@ -3535,7 +3535,7 @@ static BaseType_t prvCreateIdleTasks( void )
/* The length of the idle task name is limited to the minimum of the length /* 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 * of configIDLE_TASK_NAME and configMAX_TASK_NAME_LEN - 2, keeping space
* for the core ID suffix and the null-terminator. */ * 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 ); xCopyLen = xIdleNameLen < ( configMAX_TASK_NAME_LEN - 2 ) ? xIdleNameLen : ( configMAX_TASK_NAME_LEN - 2 );
for( xIdleTaskNameIndex = ( BaseType_t ) 0; xIdleTaskNameIndex < xCopyLen; xIdleTaskNameIndex++ ) for( xIdleTaskNameIndex = ( BaseType_t ) 0; xIdleTaskNameIndex < xCopyLen; xIdleTaskNameIndex++ )