You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by bt...@apache.org on 2020/07/30 04:13:33 UTC

[incubator-nuttx] 02/03: syslog_default_write: Fix the return value

This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 9274b67a45d2e2d6168c4e8e378c1ee452ecdd4f
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Jul 30 11:31:57 2020 +0900

    syslog_default_write: Fix the return value
    
    Found by clang-check:
    
    syslog/syslog_write.c:96:7: warning: Value stored to 'nwritten' is never read
          nwritten = g_syslog_channel->sc_write(buffer, buflen);
          ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 warning generated.
---
 drivers/syslog/syslog_write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/syslog/syslog_write.c b/drivers/syslog/syslog_write.c
index a763dd0..f5343da 100644
--- a/drivers/syslog/syslog_write.c
+++ b/drivers/syslog/syslog_write.c
@@ -105,7 +105,7 @@ static ssize_t syslog_default_write(FAR const char *buffer, size_t buflen)
         }
     }
 
-  return buflen;
+  return nwritten;
 }
 
 /****************************************************************************