diff --git a/libs/libc/stream/lib_syslogstream.c b/libs/libc/stream/lib_syslogstream.c index 21eb8654f91..961a6b1b61e 100644 --- a/libs/libc/stream/lib_syslogstream.c +++ b/libs/libc/stream/lib_syslogstream.c @@ -197,7 +197,7 @@ static int syslogstream_puts(FAR struct lib_outstream_s *this, { FAR struct lib_syslogstream_s *stream = (FAR struct lib_syslogstream_s *)this; - int ret = 0; + int ret; DEBUGASSERT(stream != NULL); if (len <= 0) @@ -205,7 +205,7 @@ static int syslogstream_puts(FAR struct lib_outstream_s *this, return 0; } - stream->last_ch = ((FAR const char *)buff)[len -1]; + stream->last_ch = ((FAR const char *)buff)[len - 1]; #ifdef CONFIG_SYSLOG_BUFFER /* Do we have an IO buffer? */ @@ -214,7 +214,7 @@ static int syslogstream_puts(FAR struct lib_outstream_s *this, { /* Add the incoming string to the buffer */ - ret += syslogstream_addstring(stream, buff, len); + ret = syslogstream_addstring(stream, buff, len); } else #endif