diff options
| author | Tim Peters <tim.peters@gmail.com> | 2001-11-28 20:27:42 +0000 |
|---|---|---|
| committer | Tim Peters <tim.peters@gmail.com> | 2001-11-28 20:27:42 +0000 |
| commit | e27cd7f4f83d57e1e5e482c7d5a18134a3759207 (patch) | |
| tree | cbbb7f439cf8abe6bbf4092d2330d489b90130ca /Modules/arraymodule.c | |
| parent | 9079b0f96f4bb939ef92dfe7612ef5ac7f6bb4df (diff) | |
| download | cpython-e27cd7f4f83d57e1e5e482c7d5a18134a3759207.tar.gz | |
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/arraymodule.c')
| -rw-r--r-- | Modules/arraymodule.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 6168bb08c6..11d0723b97 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -1313,12 +1313,13 @@ array_repr(arrayobject *a) int i, len; len = a->ob_size; if (len == 0) { - sprintf(buf, "array('%c')", a->ob_descr->typecode); + PyOS_snprintf(buf, sizeof(buf), "array('%c')", + a->ob_descr->typecode); return PyString_FromString(buf); } if (a->ob_descr->typecode == 'c') { PyObject *t_empty = PyTuple_New(0); - sprintf(buf, "array('c', "); + PyOS_snprintf(buf, sizeof(buf), "array('c', "); s = PyString_FromString(buf); v = array_tostring(a, t_empty); Py_DECREF(t_empty); @@ -1328,7 +1329,7 @@ array_repr(arrayobject *a) PyString_ConcatAndDel(&s, PyString_FromString(")")); return s; } - sprintf(buf, "array('%c', [", a->ob_descr->typecode); + PyOS_snprintf(buf, sizeof(buf), "array('%c', [", a->ob_descr->typecode); s = PyString_FromString(buf); comma = PyString_FromString(", "); for (i = 0; i < len && !PyErr_Occurred(); i++) { |
