Commit 73ed9baf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

addons: fix stream error handling

parent 5a13c1fe
...@@ -412,7 +412,7 @@ static int InstallFile( addons_storage_t *p_this, const char *psz_downloadlink, ...@@ -412,7 +412,7 @@ static int InstallFile( addons_storage_t *p_this, const char *psz_downloadlink,
return VLC_EGENERIC; return VLC_EGENERIC;
} }
while ( ( i_read = stream_Read( p_stream, &buffer, 1<<10 ) ) ) while ( ( i_read = stream_Read( p_stream, &buffer, 1<<10 ) ) > 0 )
{ {
if ( fwrite( &buffer, i_read, 1, p_destfile ) < 1 ) if ( fwrite( &buffer, i_read, 1, p_destfile ) < 1 )
{ {
......
...@@ -408,7 +408,7 @@ static int Retrieve( addons_finder_t *p_finder, addon_entry_t *p_entry ) ...@@ -408,7 +408,7 @@ static int Retrieve( addons_finder_t *p_finder, addon_entry_t *p_entry )
char buffer[1<<10]; char buffer[1<<10];
int i_read = 0; int i_read = 0;
while ( ( i_read = stream_Read( p_stream, &buffer, 1<<10 ) ) ) while ( ( i_read = stream_Read( p_stream, &buffer, 1<<10 ) ) > 0 )
{ {
if ( fwrite( &buffer, i_read, 1, p_destfile ) < 1 ) if ( fwrite( &buffer, i_read, 1, p_destfile ) < 1 )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment