mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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:
parent
05bd787c6c
commit
885d457709
15 changed files with 61 additions and 42 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue