diff options
author | truelight <truelight@openttd.org> | 2006-08-20 12:07:27 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2006-08-20 12:07:27 +0000 |
commit | b83703b215bec2b7a6147a6b4a7ec60832da5230 (patch) | |
tree | c1f29466e4787192f57ccff7170c266f90111a25 /md5.c | |
parent | c07a8613a2efa80deba600cfcf36debe3928f708 (diff) | |
download | openttd-b83703b215bec2b7a6147a6b4a7ec60832da5230.tar.xz |
(svn r5973) -Codechange: md5_append only uses size_t as nbytes param, so use that (michi_cc)
Diffstat (limited to 'md5.c')
-rw-r--r-- | md5.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -323,25 +323,25 @@ md5_init(md5_state_t *pms) } void -md5_append(md5_state_t *pms, const void *data, int nbytes) +md5_append(md5_state_t *pms, const void *data, size_t nbytes) { const md5_byte_t *p = (const md5_byte_t *)data; - int left = nbytes; - int offset = (pms->count[0] >> 3) & 63; + size_t left = nbytes; + size_t offset = (pms->count[0] >> 3) & 63; md5_word_t nbits = (md5_word_t)(nbytes << 3); if (nbytes <= 0) return; /* Update the message length. */ - pms->count[1] += nbytes >> 29; + pms->count[1] += (md5_word_t)(nbytes >> 29); pms->count[0] += nbits; if (pms->count[0] < nbits) pms->count[1]++; /* 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) |