From de95c7b5aba934f7b44746a5af5ee46477531be0 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 9 Jan 2016 16:31:36 +0100 Subject: [PATCH] Changed: Don't need to extract the original filename --- .../client/src/login_patch_seven_zip.cpp | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/code/ryzom/client/src/login_patch_seven_zip.cpp b/code/ryzom/client/src/login_patch_seven_zip.cpp index 4ce8ac122..ad58f99b2 100644 --- a/code/ryzom/client/src/login_patch_seven_zip.cpp +++ b/code/ryzom/client/src/login_patch_seven_zip.cpp @@ -280,31 +280,17 @@ bool CPatchManager::unpack7Zip(const std::string &sevenZipFile, const std::strin Byte *outBuffer = 0; /* it must be 0 before first call for each new archive. */ size_t outBufferSize = 0; /* it can have any value before first call (if outBuffer = 0) */ - size_t offset; + size_t offset = 0; size_t outSizeProcessed = 0; // get the first file - CFileItem *f = db.Database.Files; res = SzExtract(&inStr, &db, 0, &blockIndex, &outBuffer, &outBufferSize, &offset, &outSizeProcessed, &allocImp, &allocTempImp); // write the extracted file - FILE *outputHandle; - UInt32 processedSize; - char *fileName = f->Name; - size_t nameLen = strlen(f->Name); - for (; nameLen > 0; nameLen--) - { - if (f->Name[nameLen - 1] == '/') - { - fileName = f->Name + nameLen; - break; - } - } - - outputHandle = fopen(destFileName.c_str(), "wb+"); + FILE *outputHandle = fopen(destFileName.c_str(), "wb+"); if (outputHandle == 0) { @@ -312,7 +298,7 @@ bool CPatchManager::unpack7Zip(const std::string &sevenZipFile, const std::strin return false; } - processedSize = (UInt32)fwrite(outBuffer + offset, 1, outSizeProcessed, outputHandle); + UInt32 processedSize = (UInt32)fwrite(outBuffer + offset, 1, outSizeProcessed, outputHandle); if (processedSize != outSizeProcessed) {