anchao commented on code in PR #12988: URL: https://github.com/apache/nuttx/pull/12988#discussion_r1721192629
########## libs/libc/semaphore/sem_init.c: ########## @@ -79,7 +79,7 @@ int nxsem_init(FAR sem_t *sem, int pshared, unsigned int value) sem->flags = 0; #ifdef CONFIG_PRIORITY_INHERITANCE -# if CONFIG_SEM_PREALLOCHOLDERS > 0 +# if defined(CONFIG_SEM_PREALLOCHOLDERS) && CONFIG_SEM_PREALLOCHOLDERS > 0 Review Comment: move below define to `include/semaphore.h` https://github.com/apache/nuttx/blob/master/sched/semaphore/sem_holder.c#L45-L47 ########## drivers/note/note_driver.c: ########## @@ -652,7 +652,10 @@ void sched_note_start(FAR struct tcb_s *tcb) */ #if CONFIG_TASK_NAME_SIZE > 0 - namelen = strlen(tcb->name); + if (tcb->name[0] != '\0') + { + namelen = strlen(tcb->name); Review Comment: why not remove the NULL check and replace strlen() to strnlen()? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
