summaryrefslogtreecommitdiff
path: root/onlineupdate
diff options
context:
space:
mode:
Diffstat (limited to 'onlineupdate')
-rw-r--r--onlineupdate/source/update/updater/updater.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/onlineupdate/source/update/updater/updater.cxx b/onlineupdate/source/update/updater/updater.cxx
index 006e2ffe5a94..54750afb4218 100644
--- a/onlineupdate/source/update/updater/updater.cxx
+++ b/onlineupdate/source/update/updater/updater.cxx
@@ -731,8 +731,9 @@ static int ensure_copy(const NS_tchar *path, const NS_tchar *dest)
while (written < read)
{
- size_t chunkWritten = fwrite(buffer, 1, read - written, outfile);
- if (chunkWritten <= 0)
+ size_t nCount = read - written;
+ size_t chunkWritten = fwrite(buffer, 1, nCount, outfile);
+ if (chunkWritten != nCount)
{
LOG(("ensure_copy: failed to write the file: " LOG_S ", err: %d",
dest, errno));