summaryrefslogtreecommitdiffstats
path: root/Mac/Python
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-12-05 23:27:58 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-12-05 23:27:58 (GMT)
commit101de912d3613132b2eb80c802551006b3a11624 (patch)
treeecbe457e13e8567ff336644a658bc5cff73e5bcc /Mac/Python
parent8a97f4a380a7a356730e48406f8269c3efe5e6eb (diff)
downloadcpython-101de912d3613132b2eb80c802551006b3a11624.zip
cpython-101de912d3613132b2eb80c802551006b3a11624.tar.gz
cpython-101de912d3613132b2eb80c802551006b3a11624.tar.bz2
Replace sprintf() with PyOS_snprintf().
Diffstat (limited to 'Mac/Python')
-rw-r--r--Mac/Python/macimport.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Mac/Python/macimport.c b/Mac/Python/macimport.c
index b6c2d88..49d1b14 100644
--- a/Mac/Python/macimport.c
+++ b/Mac/Python/macimport.c
@@ -223,7 +223,7 @@ PyMac_LoadCodeResourceModule(name, pathname)
packagecontext = name;
shortname = lastdot+1;
}
- sprintf(funcname, FUNCNAME_PATTERN, shortname);
+ PyOS_snprintf(funcname, sizeof(funcname), FUNCNAME_PATTERN, shortname);
if( !findnamedresource((PyStringObject *)0, name, pathname, 'PYD ', fragmentname)) {
PyErr_SetString(PyExc_ImportError, "PYD resource not found");
return NULL;
@@ -235,7 +235,7 @@ PyMac_LoadCodeResourceModule(name, pathname)
kLoadCFrag, &connID, &mainAddr,
errMessage);
if ( err ) {
- sprintf(buf, "%.*s: %.200s",
+ PyOS_snprintf(buf, sizeof(buf), "%.*s: %.200s",
errMessage[0], errMessage+1,
PyMac_StrError(err));
PyErr_SetString(PyExc_ImportError, buf);
@@ -244,7 +244,7 @@ PyMac_LoadCodeResourceModule(name, pathname)
/* Locate the address of the correct init function */
err = FindSymbol(connID, Pstring(funcname), &symAddr, &class);
if ( err ) {
- sprintf(buf, "%s: %.200s",
+ PyOS_snprintf(buf, sizeof(buf), "%s: %.200s",
funcname, PyMac_StrError(err));
PyErr_SetString(PyExc_ImportError, buf);
return NULL;
@@ -405,7 +405,7 @@ error:
{
char buf[512];
- sprintf(buf, "%s: %s", filename, PyMac_StrError(err));
+ PyOS_snprintf(buf, sizeof(buf), "%s: %s", filename, PyMac_StrError(err));
PyErr_SetString(PyExc_ImportError, buf);
return NULL;
}