]> 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>
Mon, 11 Dec 2023 11:03:44 +0000 (12:03 +0100)
Before we would add all of the message buffer.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
sys-utils/dmesg.c

index adc80c259020b34cfddb857ccf4ef390b6e444fe..e64d36a3376107b027b48885b139f53a8458c3ee 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);
        }