mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Merge pull request #5939 from JonnyH/WIP/broken-fstream-copy
Try to fix File::Copy with non-1024-byte aligned sizes
This commit is contained in:
commit
8280d15357
@ -358,7 +358,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename)
|
||||
while (!input.eof())
|
||||
{
|
||||
// read input
|
||||
input.read(buffer, BSIZE);
|
||||
auto read_size = input.readsome(buffer, BSIZE);
|
||||
if (!input)
|
||||
{
|
||||
ERROR_LOG(COMMON, "Copy: failed reading from source, %s --> %s", srcFilename.c_str(),
|
||||
@ -367,7 +367,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename)
|
||||
}
|
||||
|
||||
// write output
|
||||
if (!output.WriteBytes(buffer, BSIZE))
|
||||
if (!output.WriteBytes(buffer, read_size))
|
||||
{
|
||||
ERROR_LOG(COMMON, "Copy: failed writing to output, %s --> %s: %s", srcFilename.c_str(),
|
||||
destFilename.c_str(), LastStrerrorString().c_str());
|
||||
|
Loading…
Reference in New Issue
Block a user