From 35c7dd6aba21827b32ea756b9907e8da8cec7a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E9=BE=99=20=28Armink=29?= Date: Mon, 10 Oct 2022 18:32:14 +0800 Subject: [PATCH] [ulog] fix HEX log size calculate error. --- 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 45e065dce7..430ead3f1c 100644 --- a/components/utilities/ulog/ulog.c +++ b/components/utilities/ulog/ulog.c @@ -823,7 +823,7 @@ void ulog_hexdump(const char *tag, rt_size_t width, const rt_uint8_t *buf, rt_si for (i = 0; i < size; i += width, buf += width) { - if (i + size < width) + if (i + width > size) len = size - i; else len = width;