Skip to content

Commit 193ef3d

Browse files
committed
ExtractZippedDataModule - don't forget to close zippedModule
also int -> size_t uwu
1 parent 0219e05 commit 193ef3d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Source/System/System.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ std::string System::ExtractZippedDataModule(const std::string& zippedModulePath)
265265
std::array<char, s_FileBufferSize> fileBuffer;
266266

267267
// Go through and extract every file inside this zip, overwriting every colliding file that already exists in the install directory.
268-
for (int i = 0; i < zippedModuleInfo.number_entry && !abortExtract; ++i) {
268+
for (size_t i = 0; i < zippedModuleInfo.number_entry && !abortExtract; ++i) {
269269
unz_file_info currentFileInfo;
270270
std::array<char, s_MaxFileName> outputFileInfoData;
271271
if (unzGetCurrentFileInfo(zippedModule, &currentFileInfo, outputFileInfoData.data(), s_MaxFileName, nullptr, 0, nullptr, 0) != UNZ_OK) {
@@ -348,10 +348,11 @@ std::string System::ExtractZippedDataModule(const std::string& zippedModulePath)
348348
} while (bytesRead > 0 && outputFile);
349349

350350
fclose(outputFile);
351-
unzCloseCurrentFile(zippedModule);
352-
353-
extractionProgressReport << "\tExtracted file: " + outputFileName + "\n";
354351
}
352+
353+
unzCloseCurrentFile(zippedModule);
354+
355+
extractionProgressReport << "\tExtracted file: " + outputFileName + "\n";
355356
}
356357

357358
if ((i + 1) < zippedModuleInfo.number_entry && unzGoToNextFile(zippedModule) != UNZ_OK) {

0 commit comments

Comments
 (0)