From 12f3f1bf595965f5ef5ef081fddfeee7bd05122a Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Mon, 22 Apr 2019 11:08:05 -0600 Subject: [PATCH] bpo-36672: Fix a compiler warning in winreg.SetValue() (GH-12882) (cherry picked from commit 34366b7f914eedbcc33aebe882098a2199ffaf82) Co-authored-by: Zackery Spytz --- PC/winreg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PC/winreg.c b/PC/winreg.c index e3801b257b071e..e25d176ce6a900 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -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");