Commit b2dd86de authored by Barry Warsaw's avatar Barry Warsaw

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.
parent 3d2d980f
......@@ -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';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment