summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileUtil.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-08-21 17:01:16 +0200
committerGitHub <noreply@github.com>2017-08-21 17:01:16 +0200
commit8280d15357a756523fcc71a8b12d0b401caa9605 (patch)
tree173199f031c1edee348f803a9130ee02b7a3e032 /Source/Core/Common/FileUtil.cpp
parent92b375b07ae2f1ee72d04ee39b9b53f638275583 (diff)
parent643b3ba9f8a091b4e927b63c028e6e145d549268 (diff)
Merge pull request #5939 from JonnyH/WIP/broken-fstream-copy
Try to fix File::Copy with non-1024-byte aligned sizes
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
-rw-r--r--Source/Core/Common/FileUtil.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp
index 627cf9188f..8d71dbde64 100644
--- a/Source/Core/Common/FileUtil.cpp
+++ b/Source/Core/Common/FileUtil.cpp
@@ -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());