aboutsummaryrefslogtreecommitdiff
path: root/hostname.c
diff options
context:
space:
mode:
Diffstat (limited to 'hostname.c')
-rw-r--r--hostname.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hostname.c b/hostname.c
index a6e001d54..f4118ea36 100644
--- a/hostname.c
+++ b/hostname.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: hostname.c,v 1.26 2001/03/09 21:24:12 andersen Exp $ 3 * $Id: hostname.c,v 1.27 2001/05/16 14:21:09 kraai Exp $
4 * Mini hostname implementation for busybox 4 * Mini hostname implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -112,19 +112,19 @@ int hostname_main(int argc, char **argv)
112 if (!s) 112 if (!s)
113 s = buf; 113 s = buf;
114 *s = 0; 114 *s = 0;
115 printf("%s\n", buf); 115 puts(buf);
116 } else if (opt_domain) { 116 } else if (opt_domain) {
117 s = strchr(buf, '.'); 117 s = strchr(buf, '.');
118 printf("%s\n", (s ? s + 1 : "")); 118 puts(s ? s + 1 : "");
119 } else if (opt_ip) { 119 } else if (opt_ip) {
120 h = gethostbyname(buf); 120 h = gethostbyname(buf);
121 if (!h) { 121 if (!h) {
122 printf("Host not found\n"); 122 printf("Host not found\n");
123 exit(1); 123 exit(1);
124 } 124 }
125 printf("%s\n", inet_ntoa(*(struct in_addr *) (h->h_addr))); 125 puts(inet_ntoa(*(struct in_addr *) (h->h_addr)));
126 } else { 126 } else {
127 printf("%s\n", buf); 127 puts(buf);
128 } 128 }
129 } 129 }
130 return(0); 130 return(0);