[Python-checkins] CVS: python/dist/src/Python mysnprintf.c,2.4,2.5
Barry Warsaw
bwarsaw@users.sourceforge.net
Fri, 21 Dec 2001 08:32:17 -0800
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv17104
Modified Files:
mysnprintf.c
Log Message:
PyOS_vsnprintf(): Change PyMem_Malloc() call to PyMem_MALLOC() macro,
(ditto for PyMem_Free() -> PyMem_FREE()) to fix and close SF bug
#495875 on systems that HAVE_SNPRINTF=0.
Check in on both release-22 branch and trunk.
Index: mysnprintf.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/mysnprintf.c,v
retrieving revision 2.4
retrieving revision 2.5
diff -C2 -d -r2.4 -r2.5
*** mysnprintf.c 2001/12/03 00:43:33 2.4
--- mysnprintf.c 2001/12/21 16:32:15 2.5
***************
*** 66,70 ****
#else
/* Emulate it. */
! buffer = PyMem_Malloc(size + 512);
if (buffer == NULL) {
len = -666;
--- 66,70 ----
#else
/* Emulate it. */
! buffer = PyMem_MALLOC(size + 512);
if (buffer == NULL) {
len = -666;
***************
*** 86,90 ****
str[to_copy] = '\0';
}
! PyMem_Free(buffer);
Done:
#endif
--- 86,90 ----
str[to_copy] = '\0';
}
! PyMem_FREE(buffer);
Done:
#endif