]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: only write one message to json
authorThomas Weißschuh <thomas@t-8ch.de>
Fri, 8 Dec 2023 17:10:50 +0000 (18:10 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Tue, 12 Dec 2023 11:47:59 +0000 (12:47 +0100)
Before we would add all of the message buffer.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 159ea1470d712a92e0e0b02a8d10e072acbfbaf8)

sys-utils/dmesg.c

index 5a794834c33928bf7d5bfb885616c117bb1a3462..f3784111ad40777264f89a4e7c67ebe043a5564b 100644 (file)
@@ -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);
        }