summaryrefslogtreecommitdiff
path: root/Objects/methodobject.c
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-08-24 18:34:26 +0000
committerBarry Warsaw <barry@python.org>2001-08-24 18:34:26 +0000
commit7ce3694a527afe425a2b9df65c049b0ef4e75960 (patch)
tree089937f432c69e85afbfc8308d5ebc86dd2c2c49 /Objects/methodobject.c
parentdadace004b4b94dcc4437bafc9c8407fbb1bed74 (diff)
downloadcpython-git-7ce3694a527afe425a2b9df65c049b0ef4e75960.tar.gz
repr's converted to using PyString_FromFormat() instead of sprintf'ing
into a hardcoded char* buffer. Closes patch #454743.
Diffstat (limited to 'Objects/methodobject.c')
-rw-r--r--Objects/methodobject.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index cdba3505f9..e766ba5e89 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -172,15 +172,13 @@ static struct getsetlist meth_getsets [] = {
static PyObject *
meth_repr(PyCFunctionObject *m)
{
- char buf[200];
if (m->m_self == NULL)
- sprintf(buf, "<built-in function %.80s>", m->m_ml->ml_name);
- else
- sprintf(buf,
- "<built-in method %.80s of %.80s object at %p>",
- m->m_ml->ml_name, m->m_self->ob_type->tp_name,
- m->m_self);
- return PyString_FromString(buf);
+ return PyString_FromFormat("<built-in function %s>",
+ m->m_ml->ml_name);
+ return PyString_FromFormat("<built-in method %s of %s object at %p>",
+ m->m_ml->ml_name,
+ m->m_self->ob_type->tp_name,
+ m->m_self);
}
static int