diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-12-05 23:27:58 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-12-05 23:27:58 (GMT) |
commit | 101de912d3613132b2eb80c802551006b3a11624 (patch) | |
tree | ecbe457e13e8567ff336644a658bc5cff73e5bcc /Mac/Modules | |
parent | 8a97f4a380a7a356730e48406f8269c3efe5e6eb (diff) | |
download | cpython-101de912d3613132b2eb80c802551006b3a11624.zip cpython-101de912d3613132b2eb80c802551006b3a11624.tar.gz cpython-101de912d3613132b2eb80c802551006b3a11624.tar.bz2 |
Replace sprintf() with PyOS_snprintf().
Diffstat (limited to 'Mac/Modules')
-rw-r--r-- | Mac/Modules/hfsplusmodule.c | 8 | ||||
-rw-r--r-- | Mac/Modules/macfsmodule.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Mac/Modules/hfsplusmodule.c b/Mac/Modules/hfsplusmodule.c index 56c9cca..425bdb8 100644 --- a/Mac/Modules/hfsplusmodule.c +++ b/Mac/Modules/hfsplusmodule.c @@ -1251,9 +1251,9 @@ PyObject *macos_error_for_call(OSErr err, const char *name, const char *item) char buffer[1024]; if (item) - sprintf(buffer, "mac error calling %s on %s", name, item); + PyOS_snprintf(buffer, sizeof(buffer), "mac error calling %s on %s", name, item); else - sprintf(buffer, "mac error calling %s", name); + PyOS_snprintf(buffer, sizeof(buffer), "mac error calling %s", name); v = Py_BuildValue("(is)", err, buffer); if (v != NULL) { @@ -1376,9 +1376,9 @@ void printableUniStr(const HFSUniStr255 *uni, char *buffer) UniChar uch = uni->unicode[i]; if ((uch & 0x7f) == uch) { - sprintf(localbuf, "%c", uch); + PyOS_snprintf(localbuf, sizeof(localbuf), "%c", uch); } else { - sprintf(localbuf, "\\u%04x", uch); + PyOS_snprintf(localbuf, sizeof(localbuf), "\\u%04x", uch); } strcat(buffer, localbuf); } diff --git a/Mac/Modules/macfsmodule.c b/Mac/Modules/macfsmodule.c index 9b635e3..26d7d7f 100644 --- a/Mac/Modules/macfsmodule.c +++ b/Mac/Modules/macfsmodule.c @@ -706,7 +706,7 @@ mfss_repr(mfssobject *self) { char buf[512]; - sprintf(buf, "FSSpec((%d, %ld, '%.*s'))", + PyOS_snprintf(buf, sizeof(buf), "FSSpec((%d, %ld, '%.*s'))", self->fsspec.vRefNum, self->fsspec.parID, self->fsspec.name[0], self->fsspec.name+1); |