Gary-Hobson commented on code in PR #8012: URL: https://github.com/apache/nuttx/pull/8012#discussion_r1060016811
########## drivers/syslog/vsyslog.c: ########## @@ -166,66 +168,66 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap) switch (priority) { case LOG_EMERG: /* Red, Bold, Blinking */ - ret += lib_sprintf(&stream.public, "\e[31;1;5m"); + offset += sprintf(offset, "\e[31;1;5m"); break; case LOG_ALERT: /* Red, Bold */ - ret += lib_sprintf(&stream.public, "\e[31;1m"); + offset += sprintf(offset, "\e[31;1m"); break; case LOG_CRIT: /* Red, Bold */ - ret += lib_sprintf(&stream.public, "\e[31;1m"); + offset += sprintf(offset, "\e[31;1m"); break; case LOG_ERR: /* Red */ - ret += lib_sprintf(&stream.public, "\e[31m"); + offset += sprintf(offset, "\e[31m"); break; case LOG_WARNING: /* Yellow */ - ret += lib_sprintf(&stream.public, "\e[33m"); + offset += sprintf(offset, "\e[33m"); break; case LOG_NOTICE: /* Bold */ - ret += lib_sprintf(&stream.public, "\e[1m"); + offset += sprintf(offset, "\e[1m"); break; case LOG_INFO: /* Normal */ break; case LOG_DEBUG: /* Dim */ - ret += lib_sprintf(&stream.public, "\e[2m"); + offset += sprintf(offset, "\e[2m"); break; } #endif #if defined(CONFIG_SYSLOG_PRIORITY) /* Prepend the message priority. */ - ret += lib_sprintf(&stream.public, "[%6s] ", g_priority_str[priority]); + offset += sprintf(offset, "[%6s] ", g_priority_str[priority]); #endif #if defined(CONFIG_SYSLOG_PREFIX) /* Prepend the prefix, if available */ - ret += lib_sprintf(&stream.public, "[%s] ", CONFIG_SYSLOG_PREFIX_STRING); + offset += sprintf(offset, "[%s] ", CONFIG_SYSLOG_PREFIX_STRING); #endif #if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_SYSLOG_PROCESS_NAME) /* Prepend the thread name */ tcb = nxsched_get_tcb(gettid()); - ret += lib_sprintf(&stream.public, "%s: ", - (tcb != NULL) ? tcb->name : "(null)"); + offset += sprintf(offset, "%s: ", (tcb != NULL) ? tcb->name : "(null)"); Review Comment: It's a good idea, but I recommend doing it in a separate PR ########## drivers/syslog/vsyslog.c: ########## @@ -166,66 +168,66 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap) switch (priority) { case LOG_EMERG: /* Red, Bold, Blinking */ - ret += lib_sprintf(&stream.public, "\e[31;1;5m"); + offset += sprintf(offset, "\e[31;1;5m"); break; case LOG_ALERT: /* Red, Bold */ - ret += lib_sprintf(&stream.public, "\e[31;1m"); + offset += sprintf(offset, "\e[31;1m"); break; case LOG_CRIT: /* Red, Bold */ - ret += lib_sprintf(&stream.public, "\e[31;1m"); + offset += sprintf(offset, "\e[31;1m"); break; case LOG_ERR: /* Red */ - ret += lib_sprintf(&stream.public, "\e[31m"); + offset += sprintf(offset, "\e[31m"); break; case LOG_WARNING: /* Yellow */ - ret += lib_sprintf(&stream.public, "\e[33m"); + offset += sprintf(offset, "\e[33m"); break; case LOG_NOTICE: /* Bold */ - ret += lib_sprintf(&stream.public, "\e[1m"); + offset += sprintf(offset, "\e[1m"); break; case LOG_INFO: /* Normal */ break; case LOG_DEBUG: /* Dim */ - ret += lib_sprintf(&stream.public, "\e[2m"); + offset += sprintf(offset, "\e[2m"); break; } #endif #if defined(CONFIG_SYSLOG_PRIORITY) /* Prepend the message priority. */ - ret += lib_sprintf(&stream.public, "[%6s] ", g_priority_str[priority]); + offset += sprintf(offset, "[%6s] ", g_priority_str[priority]); #endif #if defined(CONFIG_SYSLOG_PREFIX) /* Prepend the prefix, if available */ - ret += lib_sprintf(&stream.public, "[%s] ", CONFIG_SYSLOG_PREFIX_STRING); + offset += sprintf(offset, "[%s] ", CONFIG_SYSLOG_PREFIX_STRING); #endif #if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_SYSLOG_PROCESS_NAME) /* Prepend the thread name */ tcb = nxsched_get_tcb(gettid()); - ret += lib_sprintf(&stream.public, "%s: ", - (tcb != NULL) ? tcb->name : "(null)"); + offset += sprintf(offset, "%s: ", (tcb != NULL) ? tcb->name : "(null)"); Review Comment: done -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org