Using size_t for lengths (also remove most warnings when compiling for x64)

This commit is contained in:
Ley0k committed 2017-02-19 21:14:27 +01:00
1 parent a0f2dccd07
commit 85b7ac3ed5
53 files changed
+814 -514

No files matched your search

+3 -3
View File
@@ -320,10 +320,10 @@ md5_init(md5_state_t *pms)
}
void
md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
md5_append(md5_state_t *pms, const md5_byte_t *data, size_t nbytes)
{
const md5_byte_t *p = data;
int left = nbytes;
size_t left = nbytes;
int offset = (pms->count[0] >> 3) & 63;
md5_word_t nbits = (md5_word_t)(nbytes << 3);
@@ -338,7 +338,7 @@ md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
/* Process an initial partial block. */
if (offset) {
int copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
size_t copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
memcpy(pms->buf + offset, p, copy);
if (offset + copy < 64)