sprintf -> PyOS_snprintf in some "obviously safe" cases.

Also changed <>-style #includes to ""-style in some places where the
former didn't make sense.
This commit is contained in:
Tim Peters 2001-11-28 20:27:42 +00:00
parent 05bd787c6c
commit 885d457709
15 changed files with 61 additions and 42 deletions

View file

@ -2,11 +2,11 @@
* This is the High Performance Python Profiler portion of HotShot.
*/
#include <Python.h>
#include <compile.h>
#include <eval.h>
#include <frameobject.h>
#include <structmember.h>
#include "Python.h"
#include "compile.h"
#include "eval.h"
#include "frameobject.h"
#include "structmember.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@ -1452,12 +1452,12 @@ write_header(ProfilerObject *self)
pack_add_info(self, "executable-version", buffer);
#ifdef MS_WIN32
sprintf(cwdbuffer, "%I64d", frequency.QuadPart);
PyOS_snprintf(cwdbuffer, sizeof(cwdbuffer), "%I64d", frequency.QuadPart);
pack_add_info(self, "reported-performance-frequency", cwdbuffer);
#else
sprintf(cwdbuffer, "%lu", rusage_diff);
PyOS_snprintf(cwdbuffer, sizeof(cwdbuffer), "%lu", rusage_diff);
pack_add_info(self, "observed-interval-getrusage", cwdbuffer);
sprintf(cwdbuffer, "%lu", timeofday_diff);
PyOS_snprintf(cwdbuffer, sizeof(cwdbuffer), "%lu", timeofday_diff);
pack_add_info(self, "observed-interval-gettimeofday", cwdbuffer);
#endif