aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2009-11-23 22:30:22 +0000
committerMax Horn2009-11-23 22:30:22 +0000
commit6b8dd7ab7af6353f656ece14fe13c6cc4a93c5e3 (patch)
treead77e0b705af0f8703a8fc987175ceb20cde5dc2 /engines/scumm
parent3d342bec3c099039efe2452b08ea525002eac7b2 (diff)
downloadscummvm-rg350-6b8dd7ab7af6353f656ece14fe13c6cc4a93c5e3.tar.gz
scummvm-rg350-6b8dd7ab7af6353f656ece14fe13c6cc4a93c5e3.tar.bz2
scummvm-rg350-6b8dd7ab7af6353f656ece14fe13c6cc4a93c5e3.zip
COMMON: Remove various variants of the md5_file / md5_file_string funcs; turned the (disabled) MD5 test code into a working unit test
svn-id: r46108
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/detection.cpp3
-rw-r--r--engines/scumm/file_nes.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 4d984caa6d..c23d8a5529 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -378,7 +378,8 @@ static void detectGames(const Common::FSList &fslist, Common::List<DetectorResul
//
DetectorDesc &d = fileMD5Map[file];
if (d.md5.empty()) {
- if (Common::md5_file_string(d.node, md5str, kMD5FileSizeLimit)) {
+ Common::File tmp;
+ if (tmp.open(d.node) && Common::md5_file_string(tmp, md5str, kMD5FileSizeLimit)) {
d.md5 = md5str;
d.md5Entry = findInMD5Table(md5str);
diff --git a/engines/scumm/file_nes.cpp b/engines/scumm/file_nes.cpp
index e2604039a4..27840b6865 100644
--- a/engines/scumm/file_nes.cpp
+++ b/engines/scumm/file_nes.cpp
@@ -1371,7 +1371,9 @@ bool ScummNESFile::open(const Common::String &filename) {
if (_ROMset == kROMsetNum) {
char md5str[32+1];
- if (Common::md5_file_string(filename.c_str(), md5str)) {
+ File f;
+ f.open(filename);
+ if (f.isOpen() && Common::md5_file_string(f, md5str)) {
if (!strcmp(md5str, "3905799e081b80a61d4460b7b733c206")) {
_ROMset = kROMsetUSA;