summaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-06-16 13:37:59 +0000
committerDenis Vlasenko2007-06-16 13:37:59 +0000
commit7b72fc12000c878e11d5f0b245f83c0d71b29f58 (patch)
treeae60975a107756cb3b7b6dd17e8f0d41427daed6 /networking/wget.c
parent53a0e971960a520bd859b8aac6dbebec2045115f (diff)
downloadbusybox-7b72fc12000c878e11d5f0b245f83c0d71b29f58.zip
busybox-7b72fc12000c878e11d5f0b245f83c0d71b29f58.tar.gz
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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 2c060d7..fe669bb 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -693,16 +693,15 @@ progressmeter(int flag)
struct timeval now, td, tvwait;
off_t abbrevsize;
int elapsed, ratio, barlength, i;
- char buf[256];
if (flag == -1) { /* first call to progressmeter */
- gettimeofday(&start, (struct timezone *) 0);
+ gettimeofday(&start, NULL);
lastupdate = start;
lastsize = 0;
totalsize = content_len + beg_range; /* as content_len changes.. */
}
- gettimeofday(&now, (struct timezone *) 0);
+ gettimeofday(&now, NULL);
ratio = 100;
if (totalsize != 0 && !chunked) {
/* long long helps to have working ETA even if !LFS */
@@ -713,7 +712,9 @@ progressmeter(int flag)
fprintf(stderr, "\r%-20.20s%4d%% ", curfile, ratio);
barlength = getttywidth() - 51;
- if (barlength > 0 && barlength < sizeof(buf)) {
+ if (barlength > 0) {
+ /* god bless gcc for variable arrays :) */
+ char buf[barlength+1];
i = barlength * ratio / 100;
memset(buf, '*', i);
memset(buf + i, ' ', barlength - i);