diff options
author | Glenn L McGrath | 2003-08-29 06:25:04 +0000 |
---|---|---|
committer | Glenn L McGrath | 2003-08-29 06:25:04 +0000 |
commit | 23365976f8e0265adc2f21d8e330ce58e270041a (patch) | |
tree | 18a2e65c4956c521c535f46adaf898b97b861831 | |
parent | 523c1675a20cde6ae3c6a04a8d5c5285992a5fdc (diff) | |
download | busybox-23365976f8e0265adc2f21d8e330ce58e270041a.zip busybox-23365976f8e0265adc2f21d8e330ce58e270041a.tar.gz |
Correct logic in determining size of block to download, as pointed out
by Junio C Hamano
-rw-r--r-- | networking/wget.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/wget.c b/networking/wget.c index 4a10a30..5ea559b 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -484,7 +484,7 @@ read_response: progressmeter(-1); #endif do { - while ((filesize > 0 || !got_clen) && (n = safe_fread(buf, 1, (chunked || !got_clen || (filesize > sizeof(buf)) ? sizeof(buf) : filesize), dfp)) > 0) { + while ((filesize > 0 || !got_clen) && (n = safe_fread(buf, 1, ((chunked || got_clen) && (filesize < sizeof(buf)) ? filesize : sizeof(buf)), dfp)) > 0) { if (safe_fwrite(buf, 1, n, output) != n) { bb_perror_msg_and_die("write error"); } @@ -819,7 +819,7 @@ progressmeter(int flag) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: wget.c,v 1.56 2003/08/28 22:03:19 bug1 Exp $ + * $Id: wget.c,v 1.57 2003/08/29 06:25:04 bug1 Exp $ */ |