diff options
author | Ladislav <Zezula> | 2013-12-15 10:29:50 +0100 |
---|---|---|
committer | Ladislav <Zezula> | 2013-12-15 10:29:50 +0100 |
commit | fe51da468be9ca0963192c5f3a1705562bc957ba (patch) | |
tree | 767edeed5f8cd2b4561317724efdb2d1b2547d7b /src/SFileCompactArchive.cpp | |
parent | 6961cd51b65e8df7f807e25ab6ffc4da8c205449 (diff) |
+ static analysis issues fixed
Diffstat (limited to 'src/SFileCompactArchive.cpp')
-rw-r--r-- | src/SFileCompactArchive.cpp | 5 |
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 |