Kaydet (Commit) a18392a3 authored tarafından Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

#4807: Remove a wrong usage of wsprintf in the winreg module

("windows sprintf", different than swprintf)

Needed for the windows CE port.
üst c2f02216
...@@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1 ...@@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #4807: Port the _winreg module to Windows CE.
- Issue #4935: The overflow checking code in the expandtabs() method common - Issue #4935: The overflow checking code in the expandtabs() method common
to str, bytes and bytearray could be optimized away by the compiler, letting to str, bytes and bytearray could be optimized away by the compiler, letting
the interpreter segfault instead of raising an error. the interpreter segfault instead of raising an error.
......
...@@ -410,21 +410,17 @@ PyHKEY_intFunc(PyObject *ob) ...@@ -410,21 +410,17 @@ PyHKEY_intFunc(PyObject *ob)
static int static int
PyHKEY_printFunc(PyObject *ob, FILE *fp, int flags) PyHKEY_printFunc(PyObject *ob, FILE *fp, int flags)
{ {
PyHKEYObject *pyhkey = (PyHKEYObject *)ob; PyHKEYObject *pyhkey = (PyHKEYObject *)ob;
char resBuf[160]; fprintf(fp, "<PyHKEY at %p (%p)>",
wsprintf(resBuf, "<PyHKEY at %p (%p)>", ob, pyhkey->hkey);
ob, pyhkey->hkey); return 0;
fputs(resBuf, fp);
return 0;
} }
static PyObject * static PyObject *
PyHKEY_strFunc(PyObject *ob) PyHKEY_strFunc(PyObject *ob)
{ {
PyHKEYObject *pyhkey = (PyHKEYObject *)ob; PyHKEYObject *pyhkey = (PyHKEYObject *)ob;
char resBuf[160]; return PyString_FromFormat("<PyHKEY:%p>", pyhkey->hkey);
wsprintf(resBuf, "<PyHKEY:%p>", pyhkey->hkey);
return PyString_FromString(resBuf);
} }
static int static int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment