Commit 081fe46f authored by Victor Stinner's avatar Victor Stinner

Issue #9566: cast unsigned int to Py_ssize_t in md5 and sha1 modules

Fix a compiler warning on Windows 64 bits.
parent 0bec35d2
......@@ -243,7 +243,7 @@ void md5_process(struct md5_state *md5,
in += MD5_BLOCKSIZE;
inlen -= MD5_BLOCKSIZE;
} else {
n = MIN(inlen, (MD5_BLOCKSIZE - md5->curlen));
n = MIN(inlen, (Py_ssize_t)(MD5_BLOCKSIZE - md5->curlen));
memcpy(md5->buf + md5->curlen, in, (size_t)n);
md5->curlen += n;
in += n;
......
......@@ -218,7 +218,7 @@ void sha1_process(struct sha1_state *sha1,
in += SHA1_BLOCKSIZE;
inlen -= SHA1_BLOCKSIZE;
} else {
n = MIN(inlen, (SHA1_BLOCKSIZE - sha1->curlen));
n = MIN(inlen, (Py_ssize_t)(SHA1_BLOCKSIZE - sha1->curlen));
memcpy(sha1->buf + sha1->curlen, in, (size_t)n);
sha1->curlen += n;
in += n;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment