summaryrefslogtreecommitdiffstats
path: root/Modules/readline.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-11-28 20:27:42 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-11-28 20:27:42 (GMT)
commit885d457709c1d680c899dc3d035a47c8fb514cfa (patch)
treed16b3a6f89208a1b46b786958a316ef9075d3fab /Modules/readline.c
parent05bd787c6cd55f29d43465de621778221e0fc46e (diff)
downloadcpython-885d457709c1d680c899dc3d035a47c8fb514cfa.zip
cpython-885d457709c1d680c899dc3d035a47c8fb514cfa.tar.gz
cpython-885d457709c1d680c899dc3d035a47c8fb514cfa.tar.bz2
sprintf -> PyOS_snprintf in some "obviously safe" cases.
Also changed <>-style #includes to ""-style in some places where the former didn't make sense.
Diffstat (limited to 'Modules/readline.c')
-rw-r--r--Modules/readline.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/readline.c b/Modules/readline.c
index d213992..fe653b8 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -165,7 +165,7 @@ set_hook(const char * funcname, PyObject **hook_var, PyThreadState **tstate, PyO
{
PyObject *function = Py_None;
char buf[80];
- sprintf(buf, "|O:set_%.50s", funcname);
+ PyOS_snprintf(buf, sizeof(buf), "|O:set_%.50s", funcname);
if (!PyArg_ParseTuple(args, buf, &function))
return NULL;
if (function == Py_None) {
@@ -181,7 +181,9 @@ set_hook(const char * funcname, PyObject **hook_var, PyThreadState **tstate, PyO
*tstate = PyThreadState_Get();
}
else {
- sprintf(buf, "set_%.50s(func): argument not callable", funcname);
+ PyOS_snprintf(buf, sizeof(buf),
+ "set_%.50s(func): argument not callable",
+ funcname);
PyErr_SetString(PyExc_TypeError, buf);
return NULL;
}