From 1d9e99b399e72763045a2428e04b32278538ccc7 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 1 Apr 2012 16:52:21 +0200 Subject: hostname: make -i not emit extra trailing space Signed-off-by: Denys Vlasenko --- networking/hostname.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/networking/hostname.c b/networking/hostname.c index 5f663908c..d2516b5fb 100644 --- a/networking/hostname.c +++ b/networking/hostname.c @@ -153,7 +153,7 @@ int hostname_main(int argc UNUSED_PARAM, char **argv) if (hp->h_length == sizeof(struct in_addr)) { struct in_addr **h_addr_list = (struct in_addr **)hp->h_addr_list; while (*h_addr_list) { - printf("%s ", inet_ntoa(**h_addr_list)); + printf(h_addr_list[1] ? "%s " : "%s", inet_ntoa(**h_addr_list)); h_addr_list++; } bb_putchar('\n'); -- cgit v1.2.3