Fix compiler warnings on Windows 64 bit: add an explicit cast from Py_ssize_t

to int, password.len was checked for being smaller than INT_MAX.
This commit is contained in:
Victor Stinner 2013-11-16 00:27:16 +01:00
parent e990c6e952
commit c1a57d306c
1 changed files with 1 additions and 1 deletions

View File

@ -670,7 +670,7 @@ pbkdf2_hmac(PyObject *self, PyObject *args, PyObject *kwdict)
key = PyBytes_AS_STRING(key_obj); key = PyBytes_AS_STRING(key_obj);
Py_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
retval = PKCS5_PBKDF2_HMAC_fast((char*)password.buf, password.len, retval = PKCS5_PBKDF2_HMAC_fast((char*)password.buf, (int)password.len,
(unsigned char *)salt.buf, salt.len, (unsigned char *)salt.buf, salt.len,
iterations, digest, dklen, iterations, digest, dklen,
(unsigned char *)key); (unsigned char *)key);