From: =?UTF-8?Q?Martin_Je=c5=99=c3=a1bek?= Subject: [PATCH iproute2] ip: iplink_can.c: fix json formatting Date: Wed, 5 Dec 2018 16:39:20 +0100 Message-ID: <3309ad9d-4896-447a-f58f-e3848e771ff9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: =?UTF-8?Q?Martin_Je=c5=99=c3=a1bek?= To: netdev@vger.kernel.org Return-path: Received: from mail-wm1-f68.google.com ([209.85.128.68]:39333 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727701AbeLEPjY (ORCPT ); Wed, 5 Dec 2018 10:39:24 -0500 Received: by mail-wm1-f68.google.com with SMTP id f81so10914521wmd.4 for ; Wed, 05 Dec 2018 07:39:23 -0800 (PST) Content-Language: en-US-large Sender: netdev-owner@vger.kernel.org List-ID: Previously the CAN state was always printed in human-readable txt format, resulting in invalid JSON. Signed-off-by: Martin Jeřábek --- ip/iplink_can.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/iplink_can.c b/ip/iplink_can.c index c0deeb1f1fcf..5bf490a9d1c3 100644 --- a/ip/iplink_can.c +++ b/ip/iplink_can.c @@ -283,7 +283,7 @@ static void can_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) if (tb[IFLA_CAN_STATE]) { uint32_t state = rta_getattr_u32(tb[IFLA_CAN_STATE]); - fprintf(f, "state %s ", state < CAN_STATE_MAX ? + print_string(PRINT_ANY, "state", "state %s ", state < CAN_STATE_MAX ? can_state_names[state] : "UNKNOWN"); } -- 2.19.2