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

@ -25,7 +25,7 @@ can log in on your machine. Use with caution!
Python.h defines a typedef destructor, which conflicts with pthread.h.
So Python.h must be included after pthread.h. */
#include <Python.h>
#include "Python.h"
extern int Py_VerboseFlag;
@ -364,6 +364,7 @@ static void
ps(void)
{
char buffer[100];
sprintf(buffer, "ps -l -p %d </dev/null | tail +2l\n", getpid());
PyOS_snprintf(buffer, sizeof(buffer),
"ps -l -p %d </dev/null | tail +2l\n", getpid());
system(buffer);
}