add ZIP header init code, crc put code.
This commit is contained in:
@@ -47,9 +47,9 @@ int main()
|
||||
|
||||
bool ZipArchiver()
|
||||
{
|
||||
LocalFileHeader LFHeader;
|
||||
CentralDirectory CentDirec;
|
||||
EoCDRecord ECDR;
|
||||
LocalFileHeader LFHeader = {};
|
||||
CentralDirectory CentDir = {};
|
||||
EoCDRecord ECDR = {};
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -76,8 +76,13 @@ bool ZipArchiver()
|
||||
fileIn.read((char *)pFile, fileInSize);
|
||||
|
||||
// Get CRC value
|
||||
// TODO : streamsize 와 size_t 의 mismatch (long long <-> unsigned long long)
|
||||
uint32_t myCRC = getCRC32(pFile, fileInSize);
|
||||
|
||||
// Put CRC value
|
||||
LFHeader.crc32 = myCRC;
|
||||
CentDir.crc32 = myCRC;
|
||||
|
||||
// Free
|
||||
free(pFile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user