From dad97abed1fdd55c19be50ba5c1f37e55d0caead Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 30 Sep 2016 18:01:59 +0200 Subject: [PATCH] Fix some missing sign conversions --- src/cpu_md5.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cpu_md5.c b/src/cpu_md5.c index 0ef81e1e3..8c262153c 100644 --- a/src/cpu_md5.c +++ b/src/cpu_md5.c @@ -142,7 +142,7 @@ void md5_complete_no_limit (u32 digest[4], u32 *plain, u32 plain_len) // init - int remaining_len = plain_len; + int remaining_len = (int) plain_len; // loop @@ -155,11 +155,11 @@ void md5_complete_no_limit (u32 digest[4], u32 *plain, u32 plain_len) int cur_len = MIN (block_total_len, remaining_len); int copy_len = MAX (cur_len, 0); // should never be negative of course - memcpy (block_ptr, plain_ptr, copy_len); + memcpy (block_ptr, plain_ptr, (size_t) copy_len); // clear the remaining bytes of the block - memset (block_ptr + copy_len, 0, block_total_len - copy_len); + memset (block_ptr + copy_len, 0, (size_t) block_total_len - (size_t) copy_len); /* * final block @@ -171,7 +171,7 @@ void md5_complete_no_limit (u32 digest[4], u32 *plain, u32 plain_len) { if (cur_len != block_total_len) { - block_ptr[copy_len] = 0x80; + block_ptr[copy_len] = (char) 0x80; } }