diff options
author | Matt Kraai <kraai@debian.org> | 2002-04-17 15:33:24 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2002-04-17 15:33:24 +0000 |
commit | 272a95524f71c661fc00e9ebd6be3d06d57cf266 (patch) | |
tree | afe2448497a6a24ba88113854f9fb927bc2cc5f7 /networking/wget.c | |
parent | a0782684fd5076fd2ad5ca4f611249da83182108 (diff) | |
download | busybox-w32-272a95524f71c661fc00e9ebd6be3d06d57cf266.tar.gz busybox-w32-272a95524f71c661fc00e9ebd6be3d06d57cf266.tar.bz2 busybox-w32-272a95524f71c661fc00e9ebd6be3d06d57cf266.zip |
* networking/wget.c (wget_main): Check return value of safe_fwrite.
Diffstat (limited to 'networking/wget.c')
-rw-r--r-- | networking/wget.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/networking/wget.c b/networking/wget.c index 505c3f2b9..a1c18bcf1 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -481,7 +481,8 @@ read_response: if (fgets(buf, sizeof(buf), sfp) == NULL) | |||
481 | #endif | 481 | #endif |
482 | do { | 482 | do { |
483 | while ((filesize > 0 || !got_clen) && (n = safe_fread(buf, 1, chunked ? (filesize > sizeof(buf) ? sizeof(buf) : filesize) : sizeof(buf), dfp)) > 0) { | 483 | while ((filesize > 0 || !got_clen) && (n = safe_fread(buf, 1, chunked ? (filesize > sizeof(buf) ? sizeof(buf) : filesize) : sizeof(buf), dfp)) > 0) { |
484 | safe_fwrite(buf, 1, n, output); | 484 | if (safe_fwrite(buf, 1, n, output) != n) |
485 | perror_msg_and_die("write error"); | ||
485 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR | 486 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
486 | statbytes+=n; | 487 | statbytes+=n; |
487 | #endif | 488 | #endif |
@@ -817,7 +818,7 @@ progressmeter(int flag) | |||
817 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 818 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
818 | * SUCH DAMAGE. | 819 | * SUCH DAMAGE. |
819 | * | 820 | * |
820 | * $Id: wget.c,v 1.47 2002/03/19 15:22:40 kraai Exp $ | 821 | * $Id: wget.c,v 1.48 2002/04/17 15:33:24 kraai Exp $ |
821 | */ | 822 | */ |
822 | 823 | ||
823 | 824 | ||