Revert "drivers/syslog: Call up_puts in syslog_default_write instad up_putc"

This reverts commit 174b240325.

Revert "drivers/syslog: Ensure the buffer zero terminate"

This reverts commit 1692aa7894.
This commit is contained in:
ligd 2021-10-28 18:26:11 +08:00 committed by Xiang Xiao
parent ee29175811
commit ff0cd0baac
2 changed files with 8 additions and 7 deletions

View File

@ -161,8 +161,14 @@ static ssize_t syslog_default_write(FAR struct syslog_channel_s *channel,
FAR const char *buffer, size_t buflen)
{
#if defined(CONFIG_ARCH_LOWPUTC)
size_t nwritten;
nxsem_wait(&g_syslog_default_sem);
up_puts(buffer);
for (nwritten = 0; nwritten < buflen; nwritten++)
{
up_putc(buffer[nwritten]);
}
nxsem_post(&g_syslog_default_sem);
#endif

View File

@ -56,11 +56,6 @@ static int syslogstream_flush(FAR struct lib_syslogstream_s *stream)
if (iob != NULL && iob->io_len > 0)
{
/* Ensure the buffer is zero terminated */
DEBUGASSERT(iob->io_len < CONFIG_IOB_BUFSIZE);
iob->io_data[iob->io_len] = '\0';
/* Yes write the buffered data */
do
@ -105,7 +100,7 @@ static void syslogstream_addchar(FAR struct lib_syslogstream_s *stream,
/* Is the buffer full? */
if (iob->io_len >= CONFIG_IOB_BUFSIZE - 1)
if (iob->io_len >= CONFIG_IOB_BUFSIZE)
{
/* Yes.. then flush the buffer */