diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-01-13 23:19:08 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-01-13 23:19:08 (GMT) |
commit | a18392a324ba9ee8b267ac9181a67751d8150abc (patch) | |
tree | 84eba52a92f9a0f96ef9194a3d7ccfd920922b54 /PC | |
parent | c2f02216b69b844e233a2bd86ba43508fee55c86 (diff) | |
download | cpython-a18392a324ba9ee8b267ac9181a67751d8150abc.zip cpython-a18392a324ba9ee8b267ac9181a67751d8150abc.tar.gz cpython-a18392a324ba9ee8b267ac9181a67751d8150abc.tar.bz2 |
#4807: Remove a wrong usage of wsprintf in the winreg module
("windows sprintf", different than swprintf)
Needed for the windows CE port.
Diffstat (limited to 'PC')
-rw-r--r-- | PC/_winreg.c | 16 |
1 files changed, 6 insertions, 10 deletions
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, "<PyHKEY at %p (%p)>", - ob, pyhkey->hkey); - fputs(resBuf, fp); - return 0; + PyHKEYObject *pyhkey = (PyHKEYObject *)ob; + fprintf(fp, "<PyHKEY at %p (%p)>", + ob, pyhkey->hkey); + return 0; } static PyObject * PyHKEY_strFunc(PyObject *ob) { - PyHKEYObject *pyhkey = (PyHKEYObject *)ob; - char resBuf[160]; - wsprintf(resBuf, "<PyHKEY:%p>", pyhkey->hkey); - return PyString_FromString(resBuf); + PyHKEYObject *pyhkey = (PyHKEYObject *)ob; + return PyString_FromFormat("<PyHKEY:%p>", pyhkey->hkey); } static int |