bpo-36672: Fix a compiler warning in winreg.SetValue() (GH-12882)

(cherry picked from commit 34366b7f91)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
Miss Islington (bot) 2019-04-22 10:31:46 -07:00 committed by GitHub
parent 7038deed09
commit 36aecc0079
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1609,7 +1609,7 @@ winreg_SetValue_impl(PyObject *module, HKEY key, const Py_UNICODE *sub_key,
}
Py_BEGIN_ALLOW_THREADS
rc = RegSetValueW(key, sub_key, REG_SZ, value, value_length+1);
rc = RegSetValueW(key, sub_key, REG_SZ, value, (DWORD)(value_length + 1));
Py_END_ALLOW_THREADS
if (rc != ERROR_SUCCESS)
return PyErr_SetFromWindowsErrWithFunction(rc, "RegSetValue");