diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-16 13:37:59 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-16 13:37:59 +0000 |
commit | 7b72fc12000c878e11d5f0b245f83c0d71b29f58 (patch) | |
tree | ae60975a107756cb3b7b6dd17e8f0d41427daed6 /networking/wget.c | |
parent | 53a0e971960a520bd859b8aac6dbebec2045115f (diff) | |
download | busybox-w32-7b72fc12000c878e11d5f0b245f83c0d71b29f58.tar.gz busybox-w32-7b72fc12000c878e11d5f0b245f83c0d71b29f58.tar.bz2 busybox-w32-7b72fc12000c878e11d5f0b245f83c0d71b29f58.zip |
pscan: new applet (portscanner). ~1350 bytes. By Tito <farmatito@tiscali.it>
wget: lift 256 chars limitation on terminal width
Diffstat (limited to 'networking/wget.c')
-rw-r--r-- | networking/wget.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/networking/wget.c b/networking/wget.c index 2c060d77d..fe669bbdd 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -693,16 +693,15 @@ progressmeter(int flag) | |||
693 | struct timeval now, td, tvwait; | 693 | struct timeval now, td, tvwait; |
694 | off_t abbrevsize; | 694 | off_t abbrevsize; |
695 | int elapsed, ratio, barlength, i; | 695 | int elapsed, ratio, barlength, i; |
696 | char buf[256]; | ||
697 | 696 | ||
698 | if (flag == -1) { /* first call to progressmeter */ | 697 | if (flag == -1) { /* first call to progressmeter */ |
699 | gettimeofday(&start, (struct timezone *) 0); | 698 | gettimeofday(&start, NULL); |
700 | lastupdate = start; | 699 | lastupdate = start; |
701 | lastsize = 0; | 700 | lastsize = 0; |
702 | totalsize = content_len + beg_range; /* as content_len changes.. */ | 701 | totalsize = content_len + beg_range; /* as content_len changes.. */ |
703 | } | 702 | } |
704 | 703 | ||
705 | gettimeofday(&now, (struct timezone *) 0); | 704 | gettimeofday(&now, NULL); |
706 | ratio = 100; | 705 | ratio = 100; |
707 | if (totalsize != 0 && !chunked) { | 706 | if (totalsize != 0 && !chunked) { |
708 | /* long long helps to have working ETA even if !LFS */ | 707 | /* long long helps to have working ETA even if !LFS */ |
@@ -713,7 +712,9 @@ progressmeter(int flag) | |||
713 | fprintf(stderr, "\r%-20.20s%4d%% ", curfile, ratio); | 712 | fprintf(stderr, "\r%-20.20s%4d%% ", curfile, ratio); |
714 | 713 | ||
715 | barlength = getttywidth() - 51; | 714 | barlength = getttywidth() - 51; |
716 | if (barlength > 0 && barlength < sizeof(buf)) { | 715 | if (barlength > 0) { |
716 | /* god bless gcc for variable arrays :) */ | ||
717 | char buf[barlength+1]; | ||
717 | i = barlength * ratio / 100; | 718 | i = barlength * ratio / 100; |
718 | memset(buf, '*', i); | 719 | memset(buf, '*', i); |
719 | memset(buf + i, ' ', barlength - i); | 720 | memset(buf + i, ' ', barlength - i); |