From 1570151045599e0556c95b42e38393d3241d5797 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 3 Aug 2020 14:23:29 -0400 Subject: mwasmarm_patcher.c: resolve clang warnings --- tools/mwasmarm_patcher/mwasmarm_patcher.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/mwasmarm_patcher/mwasmarm_patcher.c') 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); -- cgit v1.2.3