From 1a9c8d7dfd2e69c22bec03865835be1b168be622 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Fri, 8 Dec 2023 18:10:50 +0100 Subject: [PATCH] dmesg: only write one message to json MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Before we would add all of the message buffer. Signed-off-by: Thomas Weißschuh (cherry picked from commit 159ea1470d712a92e0e0b02a8d10e072acbfbaf8) --- sys-utils/dmesg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index 5a794834c3..f3784111ad 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -1118,7 +1118,7 @@ full_output: color_disable(); } else { if (ctl->json) - ul_jsonwrt_value_s(&ctl->jfmt, "msg", line); + ul_jsonwrt_value_s_sized(&ctl->jfmt, "msg", line, mesg_size); else safe_fwrite(ctl, line, mesg_size, ctl->indent, stdout); } -- 2.47.2