diff options
author | Matt Kraai | 2001-02-01 16:49:30 +0000 |
---|---|---|
committer | Matt Kraai | 2001-02-01 16:49:30 +0000 |
commit | 05e782ddd3dc58245c889529bb8aeeaddf24bf71 (patch) | |
tree | 8fbb91ca75358923724889a558c954cffdf10136 /hostname.c | |
parent | bd018b1babf0521b8e740abb6473133c1c4c35d2 (diff) | |
download | busybox-05e782ddd3dc58245c889529bb8aeeaddf24bf71.zip busybox-05e782ddd3dc58245c889529bb8aeeaddf24bf71.tar.gz |
Fix wget error message and add (and use) chomp library function.
Diffstat (limited to 'hostname.c')
-rw-r--r-- | hostname.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,6 +1,6 @@ /* vi: set sw=4 ts=4: */ /* - * $Id: hostname.c,v 1.22 2001/01/31 19:00:20 kraai Exp $ + * $Id: hostname.c,v 1.23 2001/02/01 16:49:29 kraai Exp $ * Mini hostname implementation for busybox * * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> @@ -49,8 +49,7 @@ void do_sethostname(char *s, int isfile) f = xfopen(s, "r"); fgets(buf, 255, f); fclose(f); - if (buf[strlen(buf) - 1] == '\n') - buf[strlen(buf) - 1] = 0; + chomp(buf); if (sethostname(buf, strlen(buf)) < 0) perror_msg_and_die("sethostname"); } |