aboutsummaryrefslogtreecommitdiff
path: root/src/SFileCompactArchive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SFileCompactArchive.cpp')
-rw-r--r--src/SFileCompactArchive.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/SFileCompactArchive.cpp b/src/SFileCompactArchive.cpp
index ad9801b..5ca4065 100644
--- a/src/SFileCompactArchive.cpp
+++ b/src/SFileCompactArchive.cpp
@@ -118,7 +118,7 @@ static int CopyNonMpqData(
DataSize -= dwToRead;
}
- return ERROR_SUCCESS;
+ return nError;
}
// Copies all file sectors into another archive.
@@ -167,7 +167,7 @@ static int CopyMpqFileSectors(
// If we have to save sector offset table, do it.
if(nError == ERROR_SUCCESS && hf->SectorOffsets != NULL)
{
- DWORD * SectorOffsetsCopy = (DWORD *)STORM_ALLOC(BYTE, hf->SectorOffsets[0]);
+ DWORD * SectorOffsetsCopy = STORM_ALLOC(DWORD, hf->SectorOffsets[0] / sizeof(DWORD));
DWORD dwSectorOffsLen = hf->SectorOffsets[0];
assert((pFileEntry->dwFlags & MPQ_FILE_SINGLE_UNIT) == 0);
@@ -311,7 +311,6 @@ static int CopyMpqFileSectors(
// Include these extra data in the compressed size
dwCmpSize += dwBytesToCopy;
- dwBytesToCopy = 0;
STORM_FREE(pbExtraData);
}
else