aboutsummaryrefslogtreecommitdiff
path: root/hostname.c
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-02-01 16:49:30 +0000
committerMatt Kraai <kraai@debian.org>2001-02-01 16:49:30 +0000
commit05e782ddd3dc58245c889529bb8aeeaddf24bf71 (patch)
tree8fbb91ca75358923724889a558c954cffdf10136 /hostname.c
parentbd018b1babf0521b8e740abb6473133c1c4c35d2 (diff)
downloadbusybox-w32-05e782ddd3dc58245c889529bb8aeeaddf24bf71.tar.gz
busybox-w32-05e782ddd3dc58245c889529bb8aeeaddf24bf71.tar.bz2
busybox-w32-05e782ddd3dc58245c889529bb8aeeaddf24bf71.zip
Fix wget error message and add (and use) chomp library function.
Diffstat (limited to 'hostname.c')
-rw-r--r--hostname.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hostname.c b/hostname.c
index 3dba64154..ce17ba91c 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.22 2001/01/31 19:00:20 kraai Exp $ 3 * $Id: hostname.c,v 1.23 2001/02/01 16:49:29 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>
@@ -49,8 +49,7 @@ void do_sethostname(char *s, int isfile)
49 f = xfopen(s, "r"); 49 f = xfopen(s, "r");
50 fgets(buf, 255, f); 50 fgets(buf, 255, f);
51 fclose(f); 51 fclose(f);
52 if (buf[strlen(buf) - 1] == '\n') 52 chomp(buf);
53 buf[strlen(buf) - 1] = 0;
54 if (sethostname(buf, strlen(buf)) < 0) 53 if (sethostname(buf, strlen(buf)) < 0)
55 perror_msg_and_die("sethostname"); 54 perror_msg_and_die("sethostname");
56 } 55 }