summaryrefslogtreecommitdiff
path: root/Python/mysnprintf.c
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-12-21 16:32:15 +0000
committerBarry Warsaw <barry@python.org>2001-12-21 16:32:15 +0000
commitb2dd86defed4cc36ca2892509b73c23b39bdc558 (patch)
tree549e5ad4126cfda5a25251339c9c50344557f56e /Python/mysnprintf.c
parent3d2d980f5036c5b8c3bfce80dc570cd1e164f613 (diff)
downloadcpython-git-b2dd86defed4cc36ca2892509b73c23b39bdc558.tar.gz
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.
Diffstat (limited to 'Python/mysnprintf.c')
-rw-r--r--Python/mysnprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/mysnprintf.c b/Python/mysnprintf.c
index e3b72de2bf..4d3770d894 100644
--- a/Python/mysnprintf.c
+++ b/Python/mysnprintf.c
@@ -65,7 +65,7 @@ PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
len = vsnprintf(str, size, format, va);
#else
/* Emulate it. */
- buffer = PyMem_Malloc(size + 512);
+ buffer = PyMem_MALLOC(size + 512);
if (buffer == NULL) {
len = -666;
goto Done;
@@ -85,7 +85,7 @@ PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
memcpy(str, buffer, to_copy);
str[to_copy] = '\0';
}
- PyMem_Free(buffer);
+ PyMem_FREE(buffer);
Done:
#endif
str[size-1] = '\0';