diff options
author | Jonas Häggqvist <rasher@rasher.dk> | 2005-05-12 09:24:44 +0000 |
---|---|---|
committer | Jonas Häggqvist <rasher@rasher.dk> | 2005-05-12 09:24:44 +0000 |
commit | 97f784f804461a364bdabb25bb179dfc7f8b3c67 (patch) | |
tree | d62982eeb80359ef58565c5dd1f8a0dd0a8988fc /tools | |
parent | 441e512190d00156ba8c8ed418aca00d1de6d488 (diff) | |
download | rockbox-97f784f804461a364bdabb25bb179dfc7f8b3c67.tar.gz rockbox-97f784f804461a364bdabb25bb179dfc7f8b3c67.zip |
file must match one checksum, not all of them :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6457 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r-- | tools/fwpatcher/main.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tools/fwpatcher/main.c b/tools/fwpatcher/main.c index c8fa11ea95..b86d2f1d51 100644 --- a/tools/fwpatcher/main.c +++ b/tools/fwpatcher/main.c @@ -224,22 +224,25 @@ int PatchFirmware() goto error; } /* now md5sum it */ - if (!FileMD5(name3, md5sum_str)) goto error; + if (!FileMD5(name3, md5sum_str)) { + MessageBox(NULL, TEXT("Error in checksumming"), + TEXT("Error"), MB_ICONERROR); + goto error; + } for (i = 0; i < sizeof(checksums)/sizeof(char *); ++i) { - if (strncmp(checksums[i], md5sum_str, 32) != 0) { - MessageBox(NULL, - TEXT("Checksum doesn't match known good patched firmware.\n") - TEXT("Download another firmware image, then try again."), - TEXT("Error"), MB_ICONERROR); - goto error; + if (strncmp(checksums[i], md5sum_str, 32) == 0) { + /* all is fine, rename the patched file to original name of the firmware */ + MoveFileEx(name3, fn, MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING); + /* delete temp files */ + DeleteFile(name1); + DeleteFile(name2); + return 1; } } - /* all is fine, rename the patched file to original name of the firmware */ - MoveFileEx(name3, fn, MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING); - /* delete temp files */ - DeleteFile(name1); - DeleteFile(name2); - return 1; + MessageBox(NULL, + TEXT("Checksum doesn't match known good patched firmware.\n") + TEXT("Download another firmware image, then try again."), + TEXT("Error"), MB_ICONERROR); error: /* delete all temp files, don't care if some aren't created yet */ DeleteFile(name1); |