[Python-checkins] CVS: python/dist/src/Mac/Modules hfsplusmodule.c,1.3,1.4

Jack Jansen jackjansen@users.sourceforge.net
Wed, 05 Dec 2001 15:28:01 -0800


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

Modified Files:
	hfsplusmodule.c 
Log Message:
Replace sprintf() with PyOS_snprintf().

Index: hfsplusmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/hfsplusmodule.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** hfsplusmodule.c	2001/11/06 15:57:59	1.3
--- hfsplusmodule.c	2001/12/05 23:27:58	1.4
***************
*** 1252,1258 ****
  	
  	if (item)
! 		sprintf(buffer, "mac error calling %s on %s", name, item);
  	else
! 		sprintf(buffer, "mac error calling %s", name);
  
  	v = Py_BuildValue("(is)", err, buffer);
--- 1252,1258 ----
  	
  	if (item)
! 		PyOS_snprintf(buffer, sizeof(buffer), "mac error calling %s on %s", name, item);
  	else
! 		PyOS_snprintf(buffer, sizeof(buffer), "mac error calling %s", name);
  
  	v = Py_BuildValue("(is)", err, buffer);
***************
*** 1377,1383 ****
  
  		if ((uch & 0x7f) == uch) {
! 			sprintf(localbuf, "%c", uch);
  		} else {
! 			sprintf(localbuf, "\\u%04x", uch);
  		}
  		strcat(buffer, localbuf);
--- 1377,1383 ----
  
  		if ((uch & 0x7f) == uch) {
! 			PyOS_snprintf(localbuf, sizeof(localbuf), "%c", uch);
  		} else {
! 			PyOS_snprintf(localbuf, sizeof(localbuf), "\\u%04x", uch);
  		}
  		strcat(buffer, localbuf);