diff options
author | red031000 <rubenru09@aol.com> | 2020-08-05 01:54:56 +0100 |
---|---|---|
committer | red031000 <rubenru09@aol.com> | 2020-08-05 01:54:56 +0100 |
commit | c35e7faa7079a4ec6c095c6533591a4fca6c748d (patch) | |
tree | b15d69a86e7901e603ab5d69b8c203bfe7924079 /tools/mwasmarm_patcher/mwasmarm_patcher.c | |
parent | 4f23a1710f9c6cbf0c3cfe5d2a75c320ce681bba (diff) | |
parent | 098ffd02f95c46c18f925d0d6866b6d4a51aa86e (diff) |
Merge branch 'master' of https://github.com/pret/pokediamond
Diffstat (limited to 'tools/mwasmarm_patcher/mwasmarm_patcher.c')
-rw-r--r-- | tools/mwasmarm_patcher/mwasmarm_patcher.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/mwasmarm_patcher/mwasmarm_patcher.c b/tools/mwasmarm_patcher/mwasmarm_patcher.c index 7d15820d..e5ad3272 100644 --- a/tools/mwasmarm_patcher/mwasmarm_patcher.c +++ b/tools/mwasmarm_patcher/mwasmarm_patcher.c @@ -80,7 +80,7 @@ unsigned char * calculate_sha1 (const void * data, unsigned length) { uint32_t state[5] = {0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0};
const char * current;
unsigned remaining;
- for (current = data, remaining = length; remaining >= 64; current += 64, remaining -= 64) sha1_process_block(current, state);
+ for (current = data, remaining = length; remaining >= 64; current += 64, remaining -= 64) sha1_process_block((const uint8_t *)current, state);
// technically only {0} is necessary, but better safe than sorry
unsigned char last_block[64] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
@@ -224,9 +224,9 @@ int main(int argc, char *argv[]) { }
free(string);
- unsigned char buf[SHA_DIGEST_LENGTH*2];
+ char buf[SHA_DIGEST_LENGTH*2];
for (int i=0; i < SHA_DIGEST_LENGTH; i++) {
- sprintf((unsigned char*)&(buf[i*2]), "%02x", sha1[i]);
+ sprintf(&(buf[i*2]), "%02x", sha1[i]);
}
free(sha1);
|