diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -32,8 +32,8 @@ GRFConfig *_grfconfig_static; static bool CalcGRFMD5Sum(GRFConfig *config) { FILE *f; - md5_state_t md5state; - md5_byte_t buffer[1024]; + Md5 checksum; + uint8 buffer[1024]; size_t len, size; /* open the file */ @@ -41,12 +41,11 @@ static bool CalcGRFMD5Sum(GRFConfig *con if (f == NULL) return false; /* calculate md5sum */ - md5_init(&md5state); while ((len = fread(buffer, 1, (size > sizeof(buffer)) ? sizeof(buffer) : size, f)) != 0 && size != 0) { size -= len; - md5_append(&md5state, buffer, len); + checksum.Append(buffer, len); } - md5_finish(&md5state, config->md5sum); + checksum.Finish(config->md5sum); FioFCloseFile(f);