From a3b1015026557947b90d25acc086e5d5a4e9f0ce Mon Sep 17 00:00:00 2001 From: XuanZe <119524428@qq.com> Date: Mon, 4 Jun 2018 10:21:08 +0800 Subject: [PATCH] Update elog.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改代码 --- easylogger/src/elog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easylogger/src/elog.c b/easylogger/src/elog.c index 5c8c012..1436b0f 100644 --- a/easylogger/src/elog.c +++ b/easylogger/src/elog.c @@ -510,7 +510,7 @@ void elog_output(uint8_t level, const char *tag, const char *file, const char *f } else { log_len = ELOG_LINE_BUF_SIZE; /* copy newline sign */ - strcpy(log_buf + ELOG_LINE_BUF_SIZE -1 - newline_len, ELOG_NEWLINE_SIGN); + strcpy(log_buf + ELOG_LINE_BUF_SIZE - (newline_len + 1), ELOG_NEWLINE_SIGN); } /* output log */ #if defined(ELOG_ASYNC_OUTPUT_ENABLE)