From: Tim Peters Date: Tue, 4 Dec 2001 01:11:32 +0000 (+0000) Subject: More sprintf -> PyOS_snprintf. X-Git-Tag: v2.2.1c1~574 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22a51efc1cb9b3d5c945bf90fd8906306c367604;p=python More sprintf -> PyOS_snprintf. --- diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c index a4e997753f..b59d9a770d 100644 --- a/Modules/getbuildinfo.c +++ b/Modules/getbuildinfo.c @@ -1,4 +1,4 @@ -#include "pyconfig.h" +#include "Python.h" #ifdef macintosh #include "macbuildno.h" @@ -33,6 +33,7 @@ const char * Py_GetBuildInfo(void) { static char buildinfo[50]; - sprintf(buildinfo, "#%d, %.20s, %.9s", BUILD, DATE, TIME); + PyOS_snprintf(buildinfo, sizeof(buildinfo), + "#%d, %.20s, %.9s", BUILD, DATE, TIME); return buildinfo; } diff --git a/Python/mactoolboxglue.c b/Python/mactoolboxglue.c index ea21b4e045..2852fde2e4 100644 --- a/Python/mactoolboxglue.c +++ b/Python/mactoolboxglue.c @@ -91,7 +91,7 @@ char *PyMac_StrError(int err) HUnlock(h); ReleaseResource(h); } else { - sprintf(buf, "Mac OS error code %d", err); + PyOS_snprintf(buf, sizeof(buf), "Mac OS error code %d", err); } return buf; }