diff options
author | Chris Apers | 2004-01-20 13:44:20 +0000 |
---|---|---|
committer | Chris Apers | 2004-01-20 13:44:20 +0000 |
commit | 4679ac1f05e2bfbbf1594e596e5ec362f5e6fb0d (patch) | |
tree | 7dfcf5c2a151816cda184326060e9c4a7c93054b /scumm | |
parent | 61c37c97c7ea95e6d4c3c0e837d649b7754789e2 (diff) | |
download | scummvm-rg350-4679ac1f05e2bfbbf1594e596e5ec362f5e6fb0d.tar.gz scummvm-rg350-4679ac1f05e2bfbbf1594e596e5ec362f5e6fb0d.tar.bz2 scummvm-rg350-4679ac1f05e2bfbbf1594e596e5ec362f5e6fb0d.zip |
Hack a bit MD5 to make it work on PalmOS
svn-id: r12539
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/scummvm.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index a60e41a46e..0f20b2c40a 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -649,9 +649,20 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS } if (md5_file(buf, md5sum)) { + // HACK : changed to this code since PalmOS doesn't handle correctly %02x. + // It returns only 8 chars string in upper case so i need to use hex[], + // copy last 2 chars to md5str and convert result to lower case char md5str[32+1]; - for (int j = 0; j < 16; j++) - sprintf(md5str+j*2, "%02x", md5sum[j]); + char hex[8+1]; + for (int j = 0; j < 16; j++) { + sprintf(hex, "%02x", (int)md5sum[j]); + memcpy(md5str+j*2, hex + strlen(hex) - 2, 2); + } + + for (int j = 0; j < 32; j++) + md5str[j] = tolower(md5str[j]); + // -- + md5str[32] = 0; printf("%s %s\n", md5str, buf); const MD5Table *elem; |