]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-36672: Fix a compiler warning in winreg.SetValue() (GH-12882)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 22 Apr 2019 17:31:46 +0000 (10:31 -0700)
committerGitHub <noreply@github.com>
Mon, 22 Apr 2019 17:31:46 +0000 (10:31 -0700)
(cherry picked from commit 34366b7f914eedbcc33aebe882098a2199ffaf82)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
PC/winreg.c

index 96dd4ef059be93f0c869abc70a9a2761e669f6e4..1021609e582f6af2897d12d124f60907bdaa0fb8 100644 (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");