Skip to contentSkip to conversation

ip: iplink_can.c: fix json formatting

PATCH New Martin Jeřábek 1 participant 1 message Dec 5, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip: iplink_can.c: fix json formatting

Previously the CAN state was always printed in human-readable txt format, resulting in invalid JSON.

---
 ip/iplink_can.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ip/iplink_can.c +1 -1
index c0deeb1f1fcf..5bf490a9d1c3 100644
@@ -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");
 	}
 
Signature · 1 line
2.19.2