From: RĂ©mi Duraffort Date: Tue, 12 Feb 2008 22:04:31 +0000 (+0000) Subject: Check for the return value of fwrite. X-Git-Tag: 0.9.0-test0~2681 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=bcb07441573bbfc9e296fa5cee97a865905d2248;p=vlc Check for the return value of fwrite. --- diff --git a/src/misc/update.c b/src/misc/update.c index ba49a7c3e8..8a2e9b34cd 100644 --- a/src/misc/update.c +++ b/src/misc/update.c @@ -1287,7 +1287,11 @@ void update_DownloadReal( update_download_thread_t *p_udt ) while( ( i_read = stream_Read( p_stream, p_buffer, 1 << 10 ) ) && !intf_ProgressIsCancelled( p_udt, i_progress ) ) { - fwrite( p_buffer, i_read, 1, p_file ); + if( fwrite( p_buffer, i_read, 1, p_file ) < 1 ) + { + msg_Err( p_udt, "Failed to write into %s", psz_destfile ); + break; + } l_downloaded += i_read; psz_downloaded = size_str( l_downloaded );