Commit faa80596 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

utils: File: Save one useless loop iteration on EOF

parent e229a807
Pipeline #12598 passed with stage
in 29 minutes and 3 seconds
......@@ -71,6 +71,7 @@ bool copy( const std::string& from, const std::string& to )
return false;
unsigned char buff[4096];
size_t nbRead;
do
{
nbRead = fread( buff, 1, 4096, input.get() );
......@@ -82,8 +83,7 @@ bool copy( const std::string& from, const std::string& to )
}
if ( fwrite( buff, 1, nbRead, output.get() ) == 0 )
return false;
} while ( nbRead > 0 );
} while ( feof( input.get() ) == 0 );
return true;
}
......
Supports Markdown
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