diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-11-28 20:27:42 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-11-28 20:27:42 (GMT) |
commit | 885d457709c1d680c899dc3d035a47c8fb514cfa (patch) | |
tree | d16b3a6f89208a1b46b786958a316ef9075d3fab /Demo/pysvr | |
parent | 05bd787c6cd55f29d43465de621778221e0fc46e (diff) | |
download | cpython-885d457709c1d680c899dc3d035a47c8fb514cfa.zip cpython-885d457709c1d680c899dc3d035a47c8fb514cfa.tar.gz cpython-885d457709c1d680c899dc3d035a47c8fb514cfa.tar.bz2 |
sprintf -> PyOS_snprintf in some "obviously safe" cases.
Also changed <>-style #includes to ""-style in some places where the
former didn't make sense.
Diffstat (limited to 'Demo/pysvr')
-rw-r--r-- | Demo/pysvr/pysvr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Demo/pysvr/pysvr.c b/Demo/pysvr/pysvr.c index 99d7b07..50a122c 100644 --- a/Demo/pysvr/pysvr.c +++ b/Demo/pysvr/pysvr.c @@ -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); } |