Issue 4807: wrong wsprintf usage (original) (raw)
Note up front: there is a win32 function wsprintf() and an ISO C function swprintf(), these are different things in case you wonder.
In _winreg.c, there are two functions that use wsprintf on a char buffer, while the function takes a TCHAR buffer instead. This leads to compile warning and runtime errors when _UNICODE is defined, like e.g. under MS Windows CE. The attached patch replaces the two calls to that function with calls to fprintf() and PyString_FromFormat().