diff --git a/main.cpp b/main.cpp index ae5887e..79618ec 100644 --- a/main.cpp +++ b/main.cpp @@ -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); }