From a18392a324ba9ee8b267ac9181a67751d8150abc Mon Sep 17 00:00:00 2001 From: Amaury Forgeot d'Arc Date: Tue, 13 Jan 2009 23:19:08 +0000 Subject: #4807: Remove a wrong usage of wsprintf in the winreg module ("windows sprintf", different than swprintf) Needed for the windows CE port. --- Misc/NEWS | 2 ++ PC/_winreg.c | 16 ++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index f9122bb..7939323 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1 Core and Builtins ----------------- +- Issue #4807: Port the _winreg module to Windows CE. + - Issue #4935: The overflow checking code in the expandtabs() method common to str, bytes and bytearray could be optimized away by the compiler, letting the interpreter segfault instead of raising an error. diff --git a/PC/_winreg.c b/PC/_winreg.c index 74d3343..0cb516a 100644 --- a/PC/_winreg.c +++ b/PC/_winreg.c @@ -410,21 +410,17 @@ PyHKEY_intFunc(PyObject *ob) static int PyHKEY_printFunc(PyObject *ob, FILE *fp, int flags) { - PyHKEYObject *pyhkey = (PyHKEYObject *)ob; - char resBuf[160]; - wsprintf(resBuf, "", - ob, pyhkey->hkey); - fputs(resBuf, fp); - return 0; + PyHKEYObject *pyhkey = (PyHKEYObject *)ob; + fprintf(fp, "", + ob, pyhkey->hkey); + return 0; } static PyObject * PyHKEY_strFunc(PyObject *ob) { - PyHKEYObject *pyhkey = (PyHKEYObject *)ob; - char resBuf[160]; - wsprintf(resBuf, "", pyhkey->hkey); - return PyString_FromString(resBuf); + PyHKEYObject *pyhkey = (PyHKEYObject *)ob; + return PyString_FromFormat("", pyhkey->hkey); } static int -- cgit v0.12