aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2020-01-20 09:29:05 -0800
committerStephen Hemminger <stephen@networkplumber.org>2020-01-20 09:32:51 -0800
commitf4d7ce9bfae9710fcb984f72d1119d8bf4ff2f8c (patch)
tree2e3439ee616c12963ab64e6b1c11925a9f0c8f9c
parent970db267a0fb5036b28b2d9d4f53cb4be267ffd5 (diff)
downloadiproute2-f4d7ce9bfae9710fcb984f72d1119d8bf4ff2f8c.tar.gz
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 <stephen@networkplumber.org>
-rw-r--r--ip/ipaddress.c3
1 files changed, 2 insertions, 1 deletions
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;