From: Martin v. Löwis Date: Sun, 30 Jun 2002 06:03:35 +0000 (+0000) Subject: Undo usage of PyOS_snprintf (rev. 1.51 of PyXML). X-Git-Tag: v2.3c1~5155 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b2cf0e5ea8475436e38418eb206ada06ac52675;p=thirdparty%2FPython%2Fcpython.git Undo usage of PyOS_snprintf (rev. 1.51 of PyXML). --- diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index e1dbf2f0276d..9cf3935dad96 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