[Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.158,1.159

M.-A. Lemburg lemburg@users.sourceforge.net
Tue, 31 Jul 2001 11:05:35 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv9065/Modules

Modified Files:
	socketmodule.c 
Log Message:
Enable PyOS_snprintf() et al. during alpha phase of 2.2.0 and
add another use case to the socketmodule.



Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -C2 -d -r1.158 -r1.159
*** socketmodule.c	2001/07/30 16:52:55	1.158
--- socketmodule.c	2001/07/31 18:05:33	1.159
***************
*** 2350,2358 ****
  	}
  	if (PyInt_Check(pobj)) {
! #ifndef HAVE_SNPRINTF
! 		sprintf(pbuf, "%ld", PyInt_AsLong(pobj));
! #else
! 		snprintf(pbuf, sizeof(pbuf), "%ld", PyInt_AsLong(pobj));
! #endif
  		pptr = pbuf;
  	} else if (PyString_Check(pobj)) {
--- 2350,2354 ----
  	}
  	if (PyInt_Check(pobj)) {
! 		PyOS_snprintf(pbuf, sizeof(pbuf), "%ld", PyInt_AsLong(pobj));
  		pptr = pbuf;
  	} else if (PyString_Check(pobj)) {
***************
*** 2425,2433 ****
  	if (n == 0)
  		goto fail;
! #ifdef HAVE_SNPRINTF
! 	snprintf(pbuf, sizeof(pbuf), "%d", port);
! #else
! 	sprintf(pbuf, "%d", port);
! #endif
  	memset(&hints, 0, sizeof(hints));
  	hints.ai_family = PF_UNSPEC;
--- 2421,2425 ----
  	if (n == 0)
  		goto fail;
! 	PyOS_snprintf(pbuf, sizeof(pbuf), "%d", port);
  	memset(&hints, 0, sizeof(hints));
  	hints.ai_family = PF_UNSPEC;