summaryrefslogtreecommitdiffstats
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-06-30 06:03:35 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-06-30 06:03:35 (GMT)
commit6b2cf0e5ea8475436e38418eb206ada06ac52675 (patch)
tree82826b1c4586449ab8ab1287de340927578dfebc /Modules/pyexpat.c
parent550fd5d7994b9536fa9807957dbcb19e87c4d1e9 (diff)
downloadcpython-6b2cf0e5ea8475436e38418eb206ada06ac52675.zip
cpython-6b2cf0e5ea8475436e38418eb206ada06ac52675.tar.gz
cpython-6b2cf0e5ea8475436e38418eb206ada06ac52675.tar.bz2
Undo usage of PyOS_snprintf (rev. 1.51 of PyXML).
Diffstat (limited to 'Modules/pyexpat.c')
-rw-r--r--Modules/pyexpat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index e1dbf2f..9cf3935 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -113,7 +113,9 @@ set_error(xmlparseobject *self)
int column = XML_GetErrorColumnNumber(parser);
enum XML_Error code = XML_GetErrorCode(parser);
- PyOS_snprintf(buffer, sizeof(buffer), "%.200s: line %i, column %i",
+ /* There is no risk of overflowing this buffer, since
+ even for 64-bit integers, there is sufficient space. */
+ sprintf(buffer, "%.200s: line %i, column %i",
XML_ErrorString(code), lineno, column);
err = PyObject_CallFunction(ErrorObject, "s", buffer);
if ( err != NULL