From bf8d9aef1241880d49fcc35238aa3c73ee4ee178 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 18 Oct 2016 10:25:31 +0200 Subject: [PATCH] Changed: Check written bytes at each step and at the end --HG-- branch : develop --- .../tools/client/ryzom_installer/src/filesextractor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp b/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp index e038d93bc..bdc092d04 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/filesextractor.cpp @@ -448,8 +448,6 @@ bool CFilesExtractor::extract7z() // errors only occur when returned size is -1 if (currentProcessedSize < 0) { - error = QApplication::tr("Unable to write output file %1").arg(destPath); - res = SZ_ERROR_FAIL; break; } @@ -458,6 +456,13 @@ bool CFilesExtractor::extract7z() } while (currentSizeToProcess > 0); + if (offset != outSizeProcessed) + { + error = QApplication::tr("Unable to write output file %1 (%2 bytes written but expecting %3 bytes)").arg(destPath).arg(offset).arg(outSizeProcessed); + res = SZ_ERROR_FAIL; + break; + } + outFile.close(); totalUncompressed += SzArEx_GetFileSize(&db, i);