]> granicus.if.org Git - python/commitdiff
Undo usage of PyOS_snprintf (rev. 1.51 of PyXML).
authorMartin v. Löwis <martin@v.loewis.de>
Sun, 30 Jun 2002 06:03:35 +0000 (06:03 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sun, 30 Jun 2002 06:03:35 +0000 (06:03 +0000)
Modules/pyexpat.c

index e1dbf2f0276d4c05da3e22fc4f43aba35f0927fa..9cf3935dad9696c624c807af7f837f271054fb8d 100644 (file)
@@ -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