From: Thomas Weißschuh Date: Fri, 8 Dec 2023 17:10:50 +0000 (+0100) Subject: dmesg: only write one message to json X-Git-Tag: v2.40-rc1~111^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=159ea1470d712a92e0e0b02a8d10e072acbfbaf8;p=thirdparty%2Futil-linux.git dmesg: only write one message to json Before we would add all of the message buffer. Signed-off-by: Thomas Weißschuh --- diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index adc80c2590..e64d36a337 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); }