From c7daacc96fa384f0852b8cd12477f60ff12a7f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E9=BE=99=20=28Armink=29?= Date: Thu, 3 Jan 2019 15:31:04 +0800 Subject: [PATCH] [component][ulog] Fix the ulog_strcpy function. --- components/utilities/ulog/ulog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/utilities/ulog/ulog.c b/components/utilities/ulog/ulog.c index 186154c7c9..b813678ecd 100644 --- a/components/utilities/ulog/ulog.c +++ b/components/utilities/ulog/ulog.c @@ -149,7 +149,7 @@ size_t ulog_strcpy(size_t cur_len, char *dst, const char *src) while (*src != 0) { /* make sure destination has enough space */ - if (cur_len++ <= ULOG_LINE_BUF_SIZE) + if (cur_len++ < ULOG_LINE_BUF_SIZE) { *dst++ = *src++; }