Codechange: make the MD5 hash/digest/checksum variables a std::array

This commit is contained in:
Rubidium
2023-05-18 22:38:56 +02:00
committed by rubidium42
parent 7934418133
commit d9a04ba446
22 changed files with 91 additions and 83 deletions

View File

@@ -415,7 +415,7 @@ MD5File::ChecksumResult MD5File::CheckMD5(Subdirectory subdir, size_t max_size)
Md5 checksum;
uint8 buffer[1024];
uint8 digest[16];
MD5Hash digest;
size_t len;
while ((len = fread(buffer, 1, (size > sizeof(buffer)) ? sizeof(buffer) : size, f)) != 0 && size != 0) {
@@ -426,7 +426,7 @@ MD5File::ChecksumResult MD5File::CheckMD5(Subdirectory subdir, size_t max_size)
FioFCloseFile(f);
checksum.Finish(digest);
return memcmp(this->hash, digest, sizeof(this->hash)) == 0 ? CR_MATCH : CR_MISMATCH;
return this->hash == digest ? CR_MATCH : CR_MISMATCH;
}
/** Names corresponding to the GraphicsFileType */