From 25418ac73475c350f94ea8adf48da0c48fcfced7 Mon Sep 17 00:00:00 2001 From: valord577 Date: Mon, 31 Oct 2022 15:17:37 +0800 Subject: [PATCH] Fix: no newline when debug msg over DEBUG_BUF_SIZE Signed-off-by: valord577 --- library/debug.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/debug.c b/library/debug.c index 3969616f4f..a0cad43659 100644 --- a/library/debug.c +++ b/library/debug.c @@ -84,6 +84,10 @@ void mbedtls_debug_print_msg(const mbedtls_ssl_context *ssl, int level, str[ret] = '\n'; str[ret + 1] = '\0'; } + else + { + str[DEBUG_BUF_SIZE - 2] = '\n'; + } debug_send_line(ssl, level, file, line, str); }