[Python-checkins] CVS: python/dist/src/Demo/pysvr pysvr.c,1.9,1.10

Tim Peters tim_one@users.sourceforge.net
2001年11月28日 12:27:44 -0800


Update of /cvsroot/python/python/dist/src/Demo/pysvr
In directory usw-pr-cvs1:/tmp/cvs-serv5054/python/Demo/pysvr
Modified Files:
	pysvr.c 
Log Message:
sprintf -> PyOS_snprintf in some "obviously safe" cases.
Also changed <>-style #includes to ""-style in some places where the
former didn't make sense.
Index: pysvr.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/pysvr/pysvr.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pysvr.c	2000年11月03日 08:18:37	1.9
--- pysvr.c	2001年11月28日 20:27:42	1.10
***************
*** 26,30 ****
 So Python.h must be included after pthread.h. */
 
! #include <Python.h>
 
 extern int Py_VerboseFlag;
--- 26,30 ----
 So Python.h must be included after pthread.h. */
 
! #include "Python.h"
 
 extern int Py_VerboseFlag;
***************
*** 365,369 ****
 {
 	char buffer[100];
! 	sprintf(buffer, "ps -l -p %d </dev/null | tail +2l\n", getpid());
 	system(buffer);
 }
--- 365,370 ----
 {
 	char buffer[100];
! 	PyOS_snprintf(buffer, sizeof(buffer),
! 		 "ps -l -p %d </dev/null | tail +2l\n", getpid());
 	system(buffer);
 }

AltStyle によって変換されたページ (->オリジナル) /