diff options
Diffstat (limited to 'networking/hostname.c')
-rw-r--r-- | networking/hostname.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/networking/hostname.c b/networking/hostname.c index 3dba64154..ce17ba91c 100644 --- a/networking/hostname.c +++ b/networking/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 | } |