You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/08 19:15:50 UTC
[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #4095: drivers/syslog: Avoid prepending process name when no TCB is available
davids5 commented on a change in pull request #4095:
URL: https://github.com/apache/incubator-nuttx/pull/4095#discussion_r666455675
##########
File path: drivers/syslog/vsyslog.c
##########
@@ -206,7 +206,10 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
/* Prepend the process name */
tcb = nxsched_get_tcb(getpid());
- ret += lib_sprintf(&stream.public, "%s: ", tcb->name);
+ if (tcb != NULL)
+ {
+ ret += lib_sprintf(&stream.public, "%s: ", tcb->name);
Review comment:
To not hide the fact. What about `tcb == NULL ? "(null)" : tcb->name` in the sprintf?
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org