Issue #7171: Update syntax to replace MAX in favor of Py_MAX (matching implementation for Unix).

This commit is contained in:
Jason R. Coombs 2013-11-10 13:43:22 -05:00
parent da0fc14d46
commit 8ec784c2df
1 changed files with 5 additions and 1 deletions

View File

@ -5188,7 +5188,11 @@ socket_inet_ntop(PyObject *self, PyObject *args)
int len;
struct sockaddr_in6 addr;
DWORD addrlen, ret, retlen;
char ip[MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) + 1];
#ifdef ENABLE_IPV6
char ip[Py_MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) + 1];
#else
char ip[INET_ADDRSTRLEN + 1];
#endif
/* Guarantee NUL-termination for PyUnicode_FromString() below */
memset((void *) &ip[0], '\0', sizeof(ip));