Skip to content

Commit

Permalink
Use strlen instead of sizeof.
Browse files Browse the repository at this point in the history
This allows using pointer to string for configIDLE_TASK_NAME. Coverage
tests do that.

Signed-off-by: Gaurav Aggarwal <[email protected]>
  • Loading branch information
aggarg committed Dec 19, 2024
1 parent 2dfe9e6 commit 8dc4c83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++ )
Expand Down

0 comments on commit 8dc4c83

Please sign in to comment.