forked from mirror/OpenTTD
Codechange: make the MD5 hash/digest/checksum variables a std::array
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user