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:44:25 UTC

[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4095: drivers/syslog: Avoid prepending process name when no TCB is available

gustavonihei commented on a change in pull request #4095:
URL: https://github.com/apache/incubator-nuttx/pull/4095#discussion_r666471842



##########
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:
       Nice suggestion! I've implemented it, but I took the liberty of testing `tcb != NULL`, which is the most common case. 




-- 
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