* networking/wget.c (wget_main): Check return value of safe_fwrite.
authorMatt Kraai <kraai@debian.org>
Wed, 17 Apr 2002 15:33:24 +0000 (15:33 -0000)
committerMatt Kraai <kraai@debian.org>
Wed, 17 Apr 2002 15:33:24 +0000 (15:33 -0000)
networking/wget.c

index 505c3f2b9a3e0ab782bc149d5ec580604a55aed4..a1c18bcf1987e3fe2d7be7e6ce2fade0d008b819 100644 (file)
@@ -481,7 +481,8 @@ read_response:              if (fgets(buf, sizeof(buf), sfp) == NULL)
 #endif
        do {
                while ((filesize > 0 || !got_clen) && (n = safe_fread(buf, 1, chunked ? (filesize > sizeof(buf) ? sizeof(buf) : filesize) : sizeof(buf), dfp)) > 0) {
-               safe_fwrite(buf, 1, n, output);
+                       if (safe_fwrite(buf, 1, n, output) != n)
+                               perror_msg_and_die("write error");
 #ifdef CONFIG_FEATURE_WGET_STATUSBAR
                statbytes+=n;
 #endif
@@ -817,7 +818,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.47 2002/03/19 15:22:40 kraai Exp $
+ *     $Id: wget.c,v 1.48 2002/04/17 15:33:24 kraai Exp $
  */