From: Stephen Hemminger Date: Mon, 20 Jan 2020 17:29:05 +0000 (-0800) Subject: ip: use print_nl() to handle one line mode X-Git-Tag: v5.5.0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4d7ce9bfae9710fcb984f72d1119d8bf4ff2f8c;p=thirdparty%2Fiproute2.git ip: use print_nl() to handle one line mode The helper function print_nl() does the right thing and prints the newline or backslash. Signed-off-by: Stephen Hemminger --- diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 964f14df9..b7e913240 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -1633,7 +1633,8 @@ static int show_handler(struct rtnl_ctrl_data *ctrl, struct ifaddrmsg *ifa = NLMSG_DATA(n); open_json_object(NULL); - print_int(PRINT_ANY, "index", "if%d:\n", ifa->ifa_index); + print_int(PRINT_ANY, "index", "if%d:", ifa->ifa_index); + print_nl(); print_addrinfo(n, stdout); close_json_object(); return 0;