aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/plugin.cpp
diff options
context:
space:
mode:
authorMax Horn2007-02-14 21:59:57 +0000
committerMax Horn2007-02-14 21:59:57 +0000
commit62bd2a1544ef01896ad10565a2a9e96a5a873bfe (patch)
treed5a2977c9d1e53a7d892a5a313e9de4ae495884c /engines/scumm/plugin.cpp
parent80f799a2b25a5ff353dd572c5aeeb469688102c2 (diff)
downloadscummvm-rg350-62bd2a1544ef01896ad10565a2a9e96a5a873bfe.tar.gz
scummvm-rg350-62bd2a1544ef01896ad10565a2a9e96a5a873bfe.tar.bz2
scummvm-rg350-62bd2a1544ef01896ad10565a2a9e96a5a873bfe.zip
Make use of md5_file_string
svn-id: r25593
Diffstat (limited to 'engines/scumm/plugin.cpp')
-rw-r--r--engines/scumm/plugin.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/engines/scumm/plugin.cpp b/engines/scumm/plugin.cpp
index ce01388925..250787eaf6 100644
--- a/engines/scumm/plugin.cpp
+++ b/engines/scumm/plugin.cpp
@@ -971,7 +971,6 @@ static Common::String generateFilenameForDetection(const GameFilenamePattern &gf
struct DetectorDesc {
FilesystemNode node;
Common::String md5;
- uint8 md5sum[16];
const MD5Table *md5Entry; // Entry of the md5 table corresponding to this file, if any.
};
@@ -1013,7 +1012,6 @@ static void detectGames(const FSList &fslist, Common::List<DetectorResult> &resu
dr.game.gameid = 0;
dr.language = gfp->language;
dr.md5.clear();
- memset(dr.md5sum, 0, 16);
dr.extra = 0;
// ____ _ _
@@ -1034,19 +1032,13 @@ static void detectGames(const FSList &fslist, Common::List<DetectorResult> &resu
//
DetectorDesc &d = fileMD5Map[file];
if (d.md5.empty()) {
- uint8 md5sum[16];
- if (Common::md5_file(d.node, md5sum, kMD5FileSizeLimit)) {
- char md5str[32+1];
- for (int j = 0; j < 16; j++) {
- sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
- }
+ char md5str[32+1];
+ if (Common::md5_file_string(d.node, md5str, kMD5FileSizeLimit)) {
d.md5 = md5str;
- memcpy(d.md5sum, md5sum, 16);
d.md5Entry = findInMD5Table(md5str);
dr.md5 = d.md5;
- memcpy(dr.md5sum, d.md5sum, 16);
if (d.md5Entry) {
// Exact match found
@@ -1117,7 +1109,6 @@ static void detectGames(const FSList &fslist, Common::List<DetectorResult> &resu
// the gfp record. We then try to decide for each whether it could be
// appropriate or not.
dr.md5 = d.md5;
- memcpy(dr.md5sum, d.md5sum, 16);
for (g = gameVariantsTable; g->gameid; ++g) {
// Skip over entries with a different gameid.
if (g->gameid[0] == 0 || scumm_stricmp(gfp->gameid, g->gameid))