diff options
author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-02-01 16:49:30 +0000 |
---|---|---|
committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-02-01 16:49:30 +0000 |
commit | 69c699cc77a457820836d87ca57e53c67efe6a8a (patch) | |
tree | 8fbb91ca75358923724889a558c954cffdf10136 /networking | |
parent | 9334de44c5774ddb1aaee4bf137760ea096c358a (diff) | |
download | busybox-w32-69c699cc77a457820836d87ca57e53c67efe6a8a.tar.gz busybox-w32-69c699cc77a457820836d87ca57e53c67efe6a8a.tar.bz2 busybox-w32-69c699cc77a457820836d87ca57e53c67efe6a8a.zip |
Fix wget error message and add (and use) chomp library function.
git-svn-id: svn://busybox.net/trunk/busybox@1734 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'networking')
-rw-r--r-- | networking/hostname.c | 5 | ||||
-rw-r--r-- | networking/wget.c | 3 |
2 files changed, 4 insertions, 4 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 | } |
diff --git a/networking/wget.c b/networking/wget.c index 70f8d1b89..c134427e4 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -216,6 +216,7 @@ int wget_main(int argc, char **argv) | |||
216 | /*FALLTHRU*/ | 216 | /*FALLTHRU*/ |
217 | default: | 217 | default: |
218 | close_and_delete_outfile(output, fname_out, do_continue); | 218 | close_and_delete_outfile(output, fname_out, do_continue); |
219 | chomp(buf); | ||
219 | error_msg_and_die("server returned error %d: %s", atoi(s), buf); | 220 | error_msg_and_die("server returned error %d: %s", atoi(s), buf); |
220 | } | 221 | } |
221 | 222 | ||
@@ -532,7 +533,7 @@ progressmeter(int flag) | |||
532 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 533 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
533 | * SUCH DAMAGE. | 534 | * SUCH DAMAGE. |
534 | * | 535 | * |
535 | * $Id: wget.c,v 1.25 2001/01/31 19:00:21 kraai Exp $ | 536 | * $Id: wget.c,v 1.26 2001/02/01 16:49:30 kraai Exp $ |
536 | */ | 537 | */ |
537 | 538 | ||
538 | 539 | ||